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

Comparing trunk/RomCheater.RVACalculator/RVACalculatorPlugin.cs (file contents):
Revision 659 by william, Mon Jun 17 02:21:49 2013 UTC vs.
Revision 812 by william, Tue Apr 15 14:52:10 2014 UTC

# Line 19 | Line 19 | using System.Linq;
19   using System.Text;
20   using RomCheater.PluginFramework.Core;
21   using WeifenLuo.WinFormsUI.Docking;
22 + using Enterprise.Logging;
23  
24   namespace RomCheater.RVACalculator
25   {
26      public class RVACalculatorPlugin : UserControlPlugin
27      {
28 +        private RVACalculatorDockControl t;
29          const string name = "RVA Calculator Plugin";
30          const string description = "A simple plugin to help calculate RVA values";
31 <        public RVACalculatorPlugin() : base() { }
31 >        public RVACalculatorPlugin() : base() { t = new RVACalculatorDockControl(this); }
32          public override Guid ID
33          {
34              get { return AssemblyGuid.GetGuid(typeof(RVACalculatorPlugin)); }
# Line 52 | Line 54 | namespace RomCheater.RVACalculator
54  
55          public override void Config()
56          {
57 <            Logging.logger.Warn.WriteLine("Plugin: '{0}' guid: '{1}' - has no configurable settings", name, ID);
57 >            gLog.Warn.WriteLine("Plugin: '{0}' guid: '{1}' - has no configurable settings", name, ID);
58          }
59  
60          public override void Show() { Show(null); }
# Line 60 | Line 62 | namespace RomCheater.RVACalculator
62          public override void Show(DockPanel dockPanel, DockState dockState) { InternalShow(dockPanel, dockState); }
63          private void InternalShow(DockPanel dockPanel, DockState dockState)
64          {
65 < #if PLUGIN_ENABLED
64 <            var t = new RVACalculatorDockControl();
65 > #if PLUGIN_ENABLED            
66              if (dockPanel == null)
67              {
68                  t.Show();
# Line 74 | Line 75 | namespace RomCheater.RVACalculator
75              Logging.logger.Warn.WriteLine("Plugin: '{0}' guid: '{1}' - is currently disabled", name, ID);
76   #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   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines