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

Comparing trunk/RomCheater.EmuMMAPPlugin/EmuMMAPPlugin.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

--- trunk/RomCheater.EmuMMAPPlugin/EmuMMAPPlugin.cs	2013/06/17 08:33:06	683
+++ trunk/RomCheater.EmuMMAPPlugin/EmuMMAPPlugin.cs	2013/06/18 11:27:53	717
@@ -24,9 +24,10 @@ namespace RomCheater.EmuMMAPPlugin
 {
     public class EmuMMAPPlugin : UserControlPlugin
     {
+        EmuMEMMapDockControl t;
         const string name = "Emulator Memory Map Plugin";
         const string description = "A simple plugin to display various the memory map for various emulator(s)/device(s)";
-        public EmuMMAPPlugin() : base() { }
+        public EmuMMAPPlugin() : base() { t = new EmuMEMMapDockControl(this); }
         public override Guid ID
         {
             get { return AssemblyGuid.GetGuid(typeof(EmuMMAPPlugin)); }
@@ -60,8 +61,7 @@ namespace RomCheater.EmuMMAPPlugin
         public override void Show(DockPanel dockPanel, DockState dockState) { InternalShow(dockPanel, dockState); }
         private void InternalShow(DockPanel dockPanel, DockState dockState)
         {
-#if PLUGIN_ENABLED
-            var t = new EmuMEMMapDockControl(this);
+#if PLUGIN_ENABLED           
             if (dockPanel == null)
             {
                 t.Show();
@@ -74,5 +74,26 @@ namespace RomCheater.EmuMMAPPlugin
             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;
+            }
+        }
     }
 }