/[RomCheater]/trunk/RomCheater.PluginFramework/Core/ScratchPadPlugin.cs
ViewVC logotype

Diff of /trunk/RomCheater.PluginFramework/Core/ScratchPadPlugin.cs

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

--- trunk/RomCheater.PluginFramework/Core/ScratchPadPlugin.cs	2013/06/17 08:33:06	683
+++ trunk/RomCheater.PluginFramework/Core/ScratchPadPlugin.cs	2013/06/18 11:27:53	717
@@ -24,9 +24,10 @@
 {
     public class ScratchPadPlugin : UserControlPlugin
     {
+        ScratchPad t;
         const string name = "ScratchPad Plugin";
         const string description = "A simple plugin to scratch crap down on";
-        public ScratchPadPlugin() : base() { }
+        public ScratchPadPlugin() : base() { t = new ScratchPad(this); }
         public override Guid ID
         {
             get { return AssemblyGuid.GetGuid(typeof(ScratchPadPlugin)); }
@@ -60,8 +61,7 @@
         public override void Show(DockPanel dockPanel, DockState dockState) { InternalShow(dockPanel, dockState); }
         private void InternalShow(DockPanel dockPanel, DockState dockState)
         {
-#if PLUGIN_ENABLED
-            var t = new ScratchPad(this);
+#if PLUGIN_ENABLED            
             if (dockPanel == null)
             {
                 t.Show();
@@ -74,5 +74,26 @@
             Logging.logger.Warn.WriteLine("Plugin: '{0}' guid: '{1}' - is currently disabled", name, ID);
 #endif
         }
+
+        public override void Activate()
+        {
+            DockContentHandler handler = this.DockHandler;
+            if (handler != null)
+                handler.Activate();
+        }
+        public override void Close()
+        {
+            DockContentHandler handler = this.DockHandler;
+            if (handler != null)
+                handler.Close();
+        }
+        public override DockContentHandler DockHandler
+        {
+            get
+            {
+                if (t == null || t.DockHandler == null) return null;
+                return t.DockHandler;
+            }
+        }
     }
 }

 

  ViewVC Help
Powered by ViewVC 1.1.22