/[RomCheater]/trunk/RomCheater.EmuMMAPPlugin/EmuMMAPPlugin.cs
ViewVC logotype

Diff of /trunk/RomCheater.EmuMMAPPlugin/EmuMMAPPlugin.cs

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

--- trunk/RomCheater.EmuMMAPPlugin/EmuMMAPPlugin.cs	2013/06/17 08:33:06	683
+++ trunk/RomCheater.EmuMMAPPlugin/EmuMMAPPlugin.cs	2014/04/15 14:52:10	812
@@ -19,14 +19,16 @@
 using System.Text;
 using RomCheater.PluginFramework.Core;
 using WeifenLuo.WinFormsUI.Docking;
+using Enterprise.Logging;
 
 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)); }
@@ -52,7 +54,7 @@
 
         public override void Config()
         {
-            Logging.logger.Warn.WriteLine("Plugin: '{0}' guid: '{1}' - has no configurable settings", name, ID);
+            gLog.Warn.WriteLine("Plugin: '{0}' guid: '{1}' - has no configurable settings", name, ID);
         }
 
         public override void Show() { Show(null); }
@@ -60,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 EmuMEMMapDockControl(this);
+#if PLUGIN_ENABLED           
             if (dockPanel == null)
             {
                 t.Show();
@@ -74,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