ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/RomCheater/trunk/RomCheater.RVAScratchPad/Form1.cs
(Generate patch)

Comparing trunk/RomCheater.RVAScratchPad/Form1.cs (file contents):
Revision 711 by william, Tue Jun 18 07:24:44 2013 UTC vs.
Revision 712 by william, Tue Jun 18 08:38:20 2013 UTC

--- trunk/RomCheater.RVAScratchPad/Form1.cs	2013/06/18 08:36:08	711
+++ trunk/RomCheater.RVAScratchPad/Form1.cs	2013/06/18 08:38:20	712
@@ -9,12 +9,20 @@ using RomCheater.Logging;
 using RomCheater.Docking;
 using WeifenLuo.WinFormsUI.Docking;
 using System.IO;
+using RomCheater.PluginFramework.Core;
+using RomCheater.Core;
 
 namespace RomCheater.RVAScratchPad
 {
     public partial class Form1 : Form
     {
         private bool m_bSaveLayout = true;
+        PluginLoader loader = null;
+        IConfigPlugin ConfigPlugin = null;
+
+        IUserControlPlugin RVACalcPlugin = null;
+        IUserControlPlugin ScratchPadPlugin = null;
+
         private DeserializeDockContent m_deserializeDockContent;
         private FloatingLogWindow m_LogWindow = new FloatingLogWindow();
         private FloatingWebBrowser m_wb = new FloatingWebBrowser();
@@ -52,6 +60,27 @@ namespace RomCheater.RVAScratchPad
         private void load_plugins_silent() { load_plugins(true); }
         private void load_plugins(bool silent)
         {
+            loader = new PluginLoader();
+            loader.LoadPlugins(silent);
+
+
+            ConfigPlugin = loader.GetGenericConfigPlugin();
+            if (ConfigPlugin != null && !silent)
+                logger.Info.WriteLine("Loaded Config Plugin: {0}", ConfigPlugin.ToString());
+
+            //var UserControlPlugins = new List<IUserControlPlugin>(loader.LoadedUserControlPlugins);
+            //foreach (var userplugin in UserControlPlugins) { }
+
+
+            var config_guids = loader.GetKnownPluginGuids<IConfigPlugin>();
+            var input_guids = loader.GetKnownPluginGuids<IInputPlugin>();
+            var window_guids = loader.GetKnownPluginGuids<IWindowPlugin>();
+            var userplugin_guids = loader.GetKnownPluginGuids<IUserControlPlugin>();
+            var plugin1 = loader.GetPluginByName<IUserControlPlugin>("ScratchPad Plugin");
+            var plugin2 = loader.GetPluginByName<IUserControlPlugin>("RVA Calculator Plugin");
+
+            
+
         }
 
 
@@ -103,14 +132,14 @@ namespace RomCheater.RVAScratchPad
             if (m_LogWindow == null) return;
             //m_LogWindow.Shown += new EventHandler(AddDockToWindowList);
             //m_LogWindow.FormClosed += new FormClosedEventHandler(RemoveDockFromWindowList);
-            //m_LogWindow.Activate();
+            m_LogWindow.Activate();
         }
         private void SetupWebBrowserWindowHandler()
         {
             if (m_wb == null) return;
             //m_wb.Shown += new EventHandler(AddDockToWindowList);
             //m_wb.FormClosed += new FormClosedEventHandler(RemoveDockFromWindowList);
-            //m_msv.Activate();
+            //m_wb.Activate();
         }
         #endregion
         public void ShowDocks()
@@ -159,7 +188,7 @@ namespace RomCheater.RVAScratchPad
         {
             //dockPanel.SuspendLayout(true);
             //ShowDocks();
-            string configFile = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "DockPanel.config");
+            string configFile = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "RVAScratchPad-DockPanel.config");
             if (File.Exists(configFile))
             {
                 try
@@ -184,5 +213,10 @@ namespace RomCheater.RVAScratchPad
 
             //dockPanel.ResumeLayout(true, true);
         }
+
+        private void mnuItemExit_Click(object sender, EventArgs e)
+        {
+            this.Close();
+        }
     }
 }