/[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/05/28 19:10:10	440
+++ trunk/RomCheater.CheatPlugin/CheatCodePlugin.cs	2013/05/28 19:35:34	442
@@ -1,4 +1,5 @@
-´╗┐using System;
+´╗┐//#define PLUGIN_ENABLED // when defined the plugin is enabled, otherwise it will not be shown
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
@@ -39,23 +40,27 @@
 
         public override void Config()
         {
-            Logging.logger.Warn.WriteLine("This plugin has no configurable settings.");
+            Logging.logger.Warn.WriteLine("Plugin: '{0}' guid: '{1}' - has no configurable settings", name, ID);
         }
 
-        public override void Show()
+        public override void Show() { Show(null); }
+        public override void Show(DockPanel dockPanel) { Show(dockPanel, DockState.Document); }
+        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();
-            t.Show();
-        }
-        public override void Show(DockPanel dockPanel)
-        {
-            var t = new CheatCodeDockContent();
-            t.Show(dockPanel);
-        }
-        public override void Show(DockPanel dockPanel, DockState dockState)
-        {
-            var t = new CheatCodeDockContent();
-            t.Show(dockPanel, dockState);
+            if (dockPanel == null)
+            {
+                t.Show();
+            }
+            else
+            {
+                t.Show(dockPanel, dockState);
+            }
+#else
+            Logging.logger.Warn.WriteLine("Plugin: '{0}' guid: '{1}' - is currently disabled", name, ID);
+#endif
         }
     }
 }

 

  ViewVC Help
Powered by ViewVC 1.1.22