/[RomCheater]/trunk/RomCheater.CheatPlugin/CheatCodePlugin.cs
ViewVC logotype

Diff of /trunk/RomCheater.CheatPlugin/CheatCodePlugin.cs

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

revision 716 by william, Mon Jun 17 08:33:06 2013 UTC revision 717 by william, Tue Jun 18 11:27:53 2013 UTC
# Line 24  namespace RomCheater.CheatPlugin Line 24  namespace RomCheater.CheatPlugin
24  {  {
25      public class CheatCodePlugin : UserControlPlugin      public class CheatCodePlugin : UserControlPlugin
26      {      {
27            CheatCodeDockContent t;
28          const string name = "Cheat Code Converter Plugin";          const string name = "Cheat Code Converter Plugin";
29          const string description = "A simple plugin to allow the conversion of cheat codes to one or more formats";          const string description = "A simple plugin to allow the conversion of cheat codes to one or more formats";
30    
31          public CheatCodePlugin() : base() { }          public CheatCodePlugin() : base() { t = new CheatCodeDockContent(this); }
32          public override Guid ID          public override Guid ID
33          {          {
34              get { return AssemblyGuid.GetGuid(typeof(CheatCodePlugin)); }              get { return AssemblyGuid.GetGuid(typeof(CheatCodePlugin)); }
# Line 62  namespace RomCheater.CheatPlugin Line 62  namespace RomCheater.CheatPlugin
62          public override void Show(DockPanel dockPanel, DockState dockState) { InternalShow(dockPanel, dockState); }          public override void Show(DockPanel dockPanel, DockState dockState) { InternalShow(dockPanel, dockState); }
63          private void InternalShow(DockPanel dockPanel, DockState dockState)          private void InternalShow(DockPanel dockPanel, DockState dockState)
64          {          {
65  #if PLUGIN_ENABLED  #if PLUGIN_ENABLED          
             var t = new CheatCodeDockContent(this);  
66              if (dockPanel == null)              if (dockPanel == null)
67              {              {
68                  t.Show();                  t.Show();
# Line 76  namespace RomCheater.CheatPlugin Line 75  namespace RomCheater.CheatPlugin
75              Logging.logger.Warn.WriteLine("Plugin: '{0}' guid: '{1}' - is currently disabled", name, ID);              Logging.logger.Warn.WriteLine("Plugin: '{0}' guid: '{1}' - is currently disabled", name, ID);
76  #endif  #endif
77          }          }
78    
79            public override void Activate()
80            {
81                DockContentHandler handler = this.DockHandler;
82                if (handler != null)
83                    handler.Activate();
84            }
85            public override void Close()
86            {
87                DockContentHandler handler = this.DockHandler;
88                if (handler != null)
89                    handler.Close();
90            }
91            public override DockContentHandler DockHandler
92            {
93                get
94                {
95                    if (t == null || t.DockHandler == null) return null;
96                    return t.DockHandler;
97                }
98            }
99      }      }
100  }  }

Legend:
Removed from v.716  
changed lines
  Added in v.717

  ViewVC Help
Powered by ViewVC 1.1.22