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 683 by william, Mon Jun 17 08:33:06 2013 UTC vs.
Revision 717 by william, Tue Jun 18 11:27:53 2013 UTC

# Line 24 | Line 24 | namespace RomCheater.RVACalculator
24   {
25      public class RVACalculatorPlugin : UserControlPlugin
26      {
27 +        private RVACalculatorDockControl t;
28          const string name = "RVA Calculator Plugin";
29          const string description = "A simple plugin to help calculate RVA values";
30 <        public RVACalculatorPlugin() : base() { }
30 >        public RVACalculatorPlugin() : base() { t = new RVACalculatorDockControl(this); }
31          public override Guid ID
32          {
33              get { return AssemblyGuid.GetGuid(typeof(RVACalculatorPlugin)); }
# Line 60 | Line 61 | namespace RomCheater.RVACalculator
61          public override void Show(DockPanel dockPanel, DockState dockState) { InternalShow(dockPanel, dockState); }
62          private void InternalShow(DockPanel dockPanel, DockState dockState)
63          {
64 < #if PLUGIN_ENABLED
64 <            var t = new RVACalculatorDockControl(this);
64 > #if PLUGIN_ENABLED            
65              if (dockPanel == null)
66              {
67                  t.Show();
# Line 74 | Line 74 | namespace RomCheater.RVACalculator
74              Logging.logger.Warn.WriteLine("Plugin: '{0}' guid: '{1}' - is currently disabled", name, ID);
75   #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   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines