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

# Line 11 | Line 11 | using RomCheater.Properties;
11   using RomCheater.UserSettingsSupport;
12   using RomCheater.PluginFramework.Core;
13   using System.Diagnostics;
14 + using RomCheater.PluginFramework.Interfaces;
15  
16   namespace RomCheater
17   {
18      public partial class Main : Form
19      {
20          PluginLoader loader = null;
21 +        IConfigPlugin ConfigPlugin = null;
22 +        IInputPlugin InputPlugin = null;
23 +        IWindowPlugin WindowPlugin = null;
24          static Main()
25          {
26              SettingSubscriber.AddSubscriber(Settings.Default);
# Line 38 | Line 42 | namespace RomCheater
42              load_loggerflags();
43              LoggerInstance = logwriter;
44              LoggerInstance.CreateNewLog(false);
45 +            load_plugins();
46          }
47  
48          private void load_loggerflags()
49          {
50              logger.SetLoggingFlags((loggerflags)Logging.Properties.Settings.Default.LoggingFlags);
51          }
52 +        private void load_plugins()
53 +        {
54 +            loader = new PluginLoader();
55 +            loader.LoadPlugins();
56 +
57 +            ConfigPlugin = loader.GetConfigPlugin(RomCheater.Properties.Settings.Default.LastConfigPlugin);
58 +            if (ConfigPlugin != null)
59 +                logger.Info.WriteLine("Loaded Config Plugin: {0}", ConfigPlugin.ToString());
60 +            InputPlugin = loader.GetInputPlugin(RomCheater.Properties.Settings.Default.LastInputPlugin);
61 +            if (InputPlugin != null)
62 +                logger.Info.WriteLine("Loaded Input Plugin: {0}", InputPlugin.ToString());
63 +            WindowPlugin = loader.GetWindowPlugin(RomCheater.Properties.Settings.Default.LastWindowPlugin);
64 +            if (WindowPlugin != null)
65 +                logger.Info.WriteLine("Loaded Window Plugin: {0}", WindowPlugin.ToString());
66 +
67 +        }
68  
69          private void mnuItemExit_Click(object sender, EventArgs e)
70          {
# Line 56 | Line 77 | namespace RomCheater
77          }
78  
79          private void Main_Load(object sender, EventArgs e)
80 <        {
60 <            loader = new PluginLoader();
61 <            loader.LoadPlugins();            
80 >        {        
81          }
82  
83          private void mnuItemConfig_Click(object sender, EventArgs e)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines