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

Comparing trunk/RomCheater/Main.cs (file contents):
Revision 86 by william, Wed May 9 19:41:06 2012 UTC vs.
Revision 87 by william, Wed May 9 19:51:42 2012 UTC

--- trunk/RomCheater/Main.cs	2012/05/09 19:41:06	86
+++ trunk/RomCheater/Main.cs	2012/05/09 19:51:42	87
@@ -11,12 +11,16 @@ using RomCheater.Properties;
 using RomCheater.UserSettingsSupport;
 using RomCheater.PluginFramework.Core;
 using System.Diagnostics;
+using RomCheater.PluginFramework.Interfaces;
 
 namespace RomCheater
 {
     public partial class Main : Form
     {
         PluginLoader loader = null;
+        IConfigPlugin ConfigPlugin = null;
+        IInputPlugin InputPlugin = null;
+        IWindowPlugin WindowPlugin = null;
         static Main()
         {
             SettingSubscriber.AddSubscriber(Settings.Default);
@@ -38,12 +42,29 @@ namespace RomCheater
             load_loggerflags();
             LoggerInstance = logwriter;
             LoggerInstance.CreateNewLog(false);
+            load_plugins();
         }
 
         private void load_loggerflags()
         {
             logger.SetLoggingFlags((loggerflags)Logging.Properties.Settings.Default.LoggingFlags);
         }
+        private void load_plugins()
+        {
+            loader = new PluginLoader();
+            loader.LoadPlugins();
+
+            ConfigPlugin = loader.GetConfigPlugin(RomCheater.Properties.Settings.Default.LastConfigPlugin);
+            if (ConfigPlugin != null)
+                logger.Info.WriteLine("Loaded Config Plugin: {0}", ConfigPlugin.ToString());
+            InputPlugin = loader.GetInputPlugin(RomCheater.Properties.Settings.Default.LastInputPlugin);
+            if (InputPlugin != null)
+                logger.Info.WriteLine("Loaded Input Plugin: {0}", InputPlugin.ToString());
+            WindowPlugin = loader.GetWindowPlugin(RomCheater.Properties.Settings.Default.LastWindowPlugin);
+            if (WindowPlugin != null)
+                logger.Info.WriteLine("Loaded Window Plugin: {0}", WindowPlugin.ToString());
+
+        }
 
         private void mnuItemExit_Click(object sender, EventArgs e)
         {
@@ -56,9 +77,7 @@ namespace RomCheater
         }
 
         private void Main_Load(object sender, EventArgs e)
-        {
-            loader = new PluginLoader();
-            loader.LoadPlugins();            
+        {        
         }
 
         private void mnuItemConfig_Click(object sender, EventArgs e)