/[RomCheater]/trunk/RomCheater.RVACalculator/RVACalculatorPlugin.cs
ViewVC logotype

Diff of /trunk/RomCheater.RVACalculator/RVACalculatorPlugin.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.RVACalculator Line 24  namespace RomCheater.RVACalculator
24  {  {
25      public class RVACalculatorPlugin : UserControlPlugin      public class RVACalculatorPlugin : UserControlPlugin
26      {      {
27            private RVACalculatorDockControl t;
28          const string name = "RVA Calculator Plugin";          const string name = "RVA Calculator Plugin";
29          const string description = "A simple plugin to help calculate RVA values";          const string description = "A simple plugin to help calculate RVA values";
30          public RVACalculatorPlugin() : base() { }          public RVACalculatorPlugin() : base() { t = new RVACalculatorDockControl(this); }
31          public override Guid ID          public override Guid ID
32          {          {
33              get { return AssemblyGuid.GetGuid(typeof(RVACalculatorPlugin)); }              get { return AssemblyGuid.GetGuid(typeof(RVACalculatorPlugin)); }
# Line 60  namespace RomCheater.RVACalculator Line 61  namespace RomCheater.RVACalculator
61          public override void Show(DockPanel dockPanel, DockState dockState) { InternalShow(dockPanel, dockState); }          public override void Show(DockPanel dockPanel, DockState dockState) { InternalShow(dockPanel, dockState); }
62          private void InternalShow(DockPanel dockPanel, DockState dockState)          private void InternalShow(DockPanel dockPanel, DockState dockState)
63          {          {
64  #if PLUGIN_ENABLED  #if PLUGIN_ENABLED            
             var t = new RVACalculatorDockControl(this);  
65              if (dockPanel == null)              if (dockPanel == null)
66              {              {
67                  t.Show();                  t.Show();
# Line 74  namespace RomCheater.RVACalculator Line 74  namespace RomCheater.RVACalculator
74              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);
75  #endif  #endif
76          }          }
77    
78            public override void Activate()
79            {
80                DockContentHandler handler = this.DockHandler;
81                if (handler != null)
82                    handler.Activate();
83            }
84            public override void Close()
85            {
86                DockContentHandler handler = this.DockHandler;
87                if (handler != null)
88                    handler.Close();
89            }
90            public override DockContentHandler DockHandler
91            {
92                get
93                {
94                    if (t == null || t.DockHandler == null) return null;
95                    return t.DockHandler;
96                }
97            }
98      }      }
99  }  }

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

  ViewVC Help
Powered by ViewVC 1.1.22