/[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 715 by william, Tue Jun 18 10:51:47 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                var config = PluginCollection.GetPluginByName(PluginNames.GenericConfig);
66                var scratchpad = PluginCollection.GetPluginByName(PluginNames.ScratchPadPlugin);
67                var rvacalc = PluginCollection.GetPluginByName(PluginNames.RVACalculatorPlugin);
68                ConfigPlugin = loader.GetPluginByGuid<IConfigPlugin>(config.ID.ToString());
69                ScratchPadPlugin = loader.GetPluginByGuid<IUserControlPlugin>(scratchpad.ID.ToString());
70                RVACalcPlugin = loader.GetPluginByGuid<IUserControlPlugin>(rvacalc.ID.ToString());
71          }          }
72    
73    
# Line 103  namespace RomCheater.RVAScratchPad Line 119  namespace RomCheater.RVAScratchPad
119              if (m_LogWindow == null) return;              if (m_LogWindow == null) return;
120              //m_LogWindow.Shown += new EventHandler(AddDockToWindowList);              //m_LogWindow.Shown += new EventHandler(AddDockToWindowList);
121              //m_LogWindow.FormClosed += new FormClosedEventHandler(RemoveDockFromWindowList);              //m_LogWindow.FormClosed += new FormClosedEventHandler(RemoveDockFromWindowList);
122              //m_LogWindow.Activate();              m_LogWindow.Activate();
123          }          }
124          private void SetupWebBrowserWindowHandler()          private void SetupWebBrowserWindowHandler()
125          {          {
126              if (m_wb == null) return;              if (m_wb == null) return;
127              //m_wb.Shown += new EventHandler(AddDockToWindowList);              //m_wb.Shown += new EventHandler(AddDockToWindowList);
128              //m_wb.FormClosed += new FormClosedEventHandler(RemoveDockFromWindowList);              //m_wb.FormClosed += new FormClosedEventHandler(RemoveDockFromWindowList);
129              //m_msv.Activate();              //m_wb.Activate();
130          }          }
131          #endregion          #endregion
132          public void ShowDocks()          public void ShowDocks()
# Line 125  namespace RomCheater.RVAScratchPad Line 141  namespace RomCheater.RVAScratchPad
141              if (m_LogWindow == null || m_LogWindow.IsDisposed) { m_LogWindow = new FloatingLogWindow(); }              if (m_LogWindow == null || m_LogWindow.IsDisposed) { m_LogWindow = new FloatingLogWindow(); }
142              LoggerInstance = m_LogWindow.Logwriter;              LoggerInstance = m_LogWindow.Logwriter;
143              LoggerInstance.CreateNewLog(false);              LoggerInstance.CreateNewLog(false);
144                m_LogWindow.CloseButton = false;
145                m_LogWindow.CloseButtonVisible = false;
146              m_LogWindow.Show(dockPanel, DockState.DockBottom);              m_LogWindow.Show(dockPanel, DockState.DockBottom);
147          }          }
148    
# Line 133  namespace RomCheater.RVAScratchPad Line 151  namespace RomCheater.RVAScratchPad
151          {          {
152              //load_plugins_silent();              //load_plugins_silent();
153              m_wb = new FloatingWebBrowser();              m_wb = new FloatingWebBrowser();
154                m_wb.CloseButton = false;
155                m_wb.CloseButtonVisible = false;
156              m_wb.Show(dockPanel);              m_wb.Show(dockPanel);
157          }          }
158          #endregion          #endregion
# Line 155  namespace RomCheater.RVAScratchPad Line 175  namespace RomCheater.RVAScratchPad
175          {          {
176              //dockPanel.SuspendLayout(true);              //dockPanel.SuspendLayout(true);
177              //ShowDocks();              //ShowDocks();
178              string configFile = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "DockPanel.config");              string configFile = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "RVAScratchPad-DockPanel.config");
179              if (File.Exists(configFile))              if (File.Exists(configFile))
180              {              {
181                  try                  try
# Line 180  namespace RomCheater.RVAScratchPad Line 200  namespace RomCheater.RVAScratchPad
200    
201              //dockPanel.ResumeLayout(true, true);              //dockPanel.ResumeLayout(true, true);
202          }          }
203    
204            private void mnuItemExit_Click(object sender, EventArgs e)
205            {
206                this.Close();
207            }
208      }      }
209  }  }

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

  ViewVC Help
Powered by ViewVC 1.1.22