/[RomCheater]/trunk/RomCheater.RVAScratchPad/Form1.cs
ViewVC logotype

Diff of /trunk/RomCheater.RVAScratchPad/Form1.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 708 by william, Tue Jun 18 07:23:04 2013 UTC revision 713 by william, Tue Jun 18 10:25:55 2013 UTC
# Line 9  using RomCheater.Logging; Line 9  using RomCheater.Logging;
9  using RomCheater.Docking;  using RomCheater.Docking;
10  using WeifenLuo.WinFormsUI.Docking;  using WeifenLuo.WinFormsUI.Docking;
11  using System.IO;  using System.IO;
12    using RomCheater.PluginFramework.Core;
13    using RomCheater.Core;
14    
15  namespace RomCheater.RVAScratchPad  namespace RomCheater.RVAScratchPad
16  {  {
17      public partial class Form1 : Form      public partial class Form1 : Form
18      {      {
19          private bool m_bSaveLayout = true;          private bool m_bSaveLayout = true;
20            PluginLoader loader = null;
21            IConfigPlugin ConfigPlugin = null;
22    
23            IUserControlPlugin RVACalcPlugin = null;
24            IUserControlPlugin ScratchPadPlugin = null;
25    
26          private DeserializeDockContent m_deserializeDockContent;          private DeserializeDockContent m_deserializeDockContent;
27          private FloatingLogWindow m_LogWindow = new FloatingLogWindow();          private FloatingLogWindow m_LogWindow = new FloatingLogWindow();
28          private FloatingWebBrowser m_wb = new FloatingWebBrowser();          private FloatingWebBrowser m_wb = new FloatingWebBrowser();
# Line 52  namespace RomCheater.RVAScratchPad Line 60  namespace RomCheater.RVAScratchPad
60          private void load_plugins_silent() { load_plugins(true); }          private void load_plugins_silent() { load_plugins(true); }
61          private void load_plugins(bool silent)          private void load_plugins(bool silent)
62          {          {
63                loader = new PluginLoader();
64                loader.LoadPlugins(silent);
65    
66    
67                ConfigPlugin = loader.GetGenericConfigPlugin();
68                if (ConfigPlugin != null && !silent)
69                    logger.Info.WriteLine("Loaded Config Plugin: {0}", ConfigPlugin.ToString());
70    
71                //var UserControlPlugins = new List<IUserControlPlugin>(loader.LoadedUserControlPlugins);
72                //foreach (var userplugin in UserControlPlugins) { }
73    
74    
75                //var config_guids = loader.GetKnownPluginGuids<IConfigPlugin>();
76                //var input_guids = loader.GetKnownPluginGuids<IInputPlugin>();
77                //var window_guids = loader.GetKnownPluginGuids<IWindowPlugin>();
78                //var userplugin_guids = loader.GetKnownPluginGuids<IUserControlPlugin>();
79                //var plugin1 = loader.GetPluginByName<IUserControlPlugin>("ScratchPad Plugin");
80                //var plugin2 = loader.GetPluginByName<IUserControlPlugin>("RVA Calculator Plugin");
81    
82    
83                //var plugin1 = PluginCollection.UserControlPlugins.CheatCodePlugin.Plugin;
84                //var plugin2 = PluginCollection.UserControlPlugins.EmuMMAPPlugin.Plugin;
85                //var plugin3 = PluginCollection.UserControlPlugins.RVACalculatorPlugin.Plugin;
86                //var plugin4 = PluginCollection.UserControlPlugins.ScratchPadPlugin.Plugin;
87    
88                //var plugin1 = PluginCollection.GetPluginByName(PluginNames.ScratchPadPlugin);
89                //var plugin2 = PluginCollection.GetPluginByName(PluginNames.RVACalculatorPlugin);            
90    
91                var plugins = PluginCollection.GetPluginsByType(PluginType.Window);
92    
93          }          }
94    
95    
# Line 103  namespace RomCheater.RVAScratchPad Line 141  namespace RomCheater.RVAScratchPad
141              if (m_LogWindow == null) return;              if (m_LogWindow == null) return;
142              //m_LogWindow.Shown += new EventHandler(AddDockToWindowList);              //m_LogWindow.Shown += new EventHandler(AddDockToWindowList);
143              //m_LogWindow.FormClosed += new FormClosedEventHandler(RemoveDockFromWindowList);              //m_LogWindow.FormClosed += new FormClosedEventHandler(RemoveDockFromWindowList);
144              //m_LogWindow.Activate();              m_LogWindow.Activate();
145          }          }
146          private void SetupWebBrowserWindowHandler()          private void SetupWebBrowserWindowHandler()
147          {          {
148              if (m_wb == null) return;              if (m_wb == null) return;
149              //m_wb.Shown += new EventHandler(AddDockToWindowList);              //m_wb.Shown += new EventHandler(AddDockToWindowList);
150              //m_wb.FormClosed += new FormClosedEventHandler(RemoveDockFromWindowList);              //m_wb.FormClosed += new FormClosedEventHandler(RemoveDockFromWindowList);
151              //m_msv.Activate();              //m_wb.Activate();
152          }          }
153          #endregion          #endregion
154          public void ShowDocks()          public void ShowDocks()
# Line 125  namespace RomCheater.RVAScratchPad Line 163  namespace RomCheater.RVAScratchPad
163              if (m_LogWindow == null || m_LogWindow.IsDisposed) { m_LogWindow = new FloatingLogWindow(); }              if (m_LogWindow == null || m_LogWindow.IsDisposed) { m_LogWindow = new FloatingLogWindow(); }
164              LoggerInstance = m_LogWindow.Logwriter;              LoggerInstance = m_LogWindow.Logwriter;
165              LoggerInstance.CreateNewLog(false);              LoggerInstance.CreateNewLog(false);
166                m_LogWindow.CloseButton = false;
167                m_LogWindow.CloseButtonVisible = false;
168              m_LogWindow.Show(dockPanel, DockState.DockBottom);              m_LogWindow.Show(dockPanel, DockState.DockBottom);
169          }          }
170    
# Line 133  namespace RomCheater.RVAScratchPad Line 173  namespace RomCheater.RVAScratchPad
173          {          {
174              //load_plugins_silent();              //load_plugins_silent();
175              m_wb = new FloatingWebBrowser();              m_wb = new FloatingWebBrowser();
176                m_wb.CloseButton = false;
177                m_wb.CloseButtonVisible = false;
178              m_wb.Show(dockPanel);              m_wb.Show(dockPanel);
179          }          }
180          #endregion          #endregion
# Line 155  namespace RomCheater.RVAScratchPad Line 197  namespace RomCheater.RVAScratchPad
197          {          {
198              //dockPanel.SuspendLayout(true);              //dockPanel.SuspendLayout(true);
199              //ShowDocks();              //ShowDocks();
200              string configFile = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "DockPanel.config");              string configFile = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "RVAScratchPad-DockPanel.config");
201              if (File.Exists(configFile))              if (File.Exists(configFile))
202              {              {
203                  try                  try
# Line 180  namespace RomCheater.RVAScratchPad Line 222  namespace RomCheater.RVAScratchPad
222    
223              //dockPanel.ResumeLayout(true, true);              //dockPanel.ResumeLayout(true, true);
224          }          }
225    
226            private void mnuItemExit_Click(object sender, EventArgs e)
227            {
228                this.Close();
229            }
230      }      }
231  }  }

Legend:
Removed from v.708  
changed lines
  Added in v.713

  ViewVC Help
Powered by ViewVC 1.1.22