/[RomCheater]/trunk/RomCheater.CheatPlugin/CheatCodePlugin.cs
ViewVC logotype

Diff of /trunk/RomCheater.CheatPlugin/CheatCodePlugin.cs

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

--- trunk/RomCheater.CheatPlugin/CheatCodePlugin.cs	2013/06/17 08:33:06	683
+++ trunk/RomCheater.CheatPlugin/CheatCodePlugin.cs	2013/06/18 11:27:53	717
@@ -24,11 +24,11 @@
 {
     public class CheatCodePlugin : UserControlPlugin
     {
-
+        CheatCodeDockContent t;
         const string name = "Cheat Code Converter Plugin";
         const string description = "A simple plugin to allow the conversion of cheat codes to one or more formats";
 
-        public CheatCodePlugin() : base() { }
+        public CheatCodePlugin() : base() { t = new CheatCodeDockContent(this); }
         public override Guid ID
         {
             get { return AssemblyGuid.GetGuid(typeof(CheatCodePlugin)); }
@@ -62,8 +62,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 CheatCodeDockContent(this);
+#if PLUGIN_ENABLED           
             if (dockPanel == null)
             {
                 t.Show();
@@ -76,5 +75,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