/[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 683 by william, Mon Jun 17 08:33:06 2013 UTC revision 812 by william, Tue Apr 15 14:52:10 2014 UTC
# Line 19  using System.Linq; Line 19  using System.Linq;
19  using System.Text;  using System.Text;
20  using RomCheater.PluginFramework.Core;  using RomCheater.PluginFramework.Core;
21  using WeifenLuo.WinFormsUI.Docking;  using WeifenLuo.WinFormsUI.Docking;
22    using Enterprise.Logging;
23    
24  namespace RomCheater.RVACalculator  namespace RomCheater.RVACalculator
25  {  {
26      public class RVACalculatorPlugin : UserControlPlugin      public class RVACalculatorPlugin : UserControlPlugin
27      {      {
28            private RVACalculatorDockControl t;
29          const string name = "RVA Calculator Plugin";          const string name = "RVA Calculator Plugin";
30          const string description = "A simple plugin to help calculate RVA values";          const string description = "A simple plugin to help calculate RVA values";
31          public RVACalculatorPlugin() : base() { }          public RVACalculatorPlugin() : base() { t = new RVACalculatorDockControl(this); }
32          public override Guid ID          public override Guid ID
33          {          {
34              get { return AssemblyGuid.GetGuid(typeof(RVACalculatorPlugin)); }              get { return AssemblyGuid.GetGuid(typeof(RVACalculatorPlugin)); }
# Line 52  namespace RomCheater.RVACalculator Line 54  namespace RomCheater.RVACalculator
54    
55          public override void Config()          public override void Config()
56          {          {
57              Logging.logger.Warn.WriteLine("Plugin: '{0}' guid: '{1}' - has no configurable settings", name, ID);              gLog.Warn.WriteLine("Plugin: '{0}' guid: '{1}' - has no configurable settings", name, ID);
58          }          }
59    
60          public override void Show() { Show(null); }          public override void Show() { Show(null); }
# Line 60  namespace RomCheater.RVACalculator Line 62  namespace RomCheater.RVACalculator
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 RVACalculatorDockControl(this);  
66              if (dockPanel == null)              if (dockPanel == null)
67              {              {
68                  t.Show();                  t.Show();
# Line 74  namespace RomCheater.RVACalculator Line 75  namespace RomCheater.RVACalculator
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.683  
changed lines
  Added in v.812

  ViewVC Help
Powered by ViewVC 1.1.22