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

Comparing trunk/RomCheater.CheatPlugin/CheatCodePlugin.cs (file contents):
Revision 440 by william, Tue May 28 19:10:10 2013 UTC vs.
Revision 442 by william, Tue May 28 19:35:34 2013 UTC

# Line 1 | Line 1
1 < using System;
1 > //#define PLUGIN_ENABLED // when defined the plugin is enabled, otherwise it will not be shown
2 > using System;
3   using System.Collections.Generic;
4   using System.Linq;
5   using System.Text;
# Line 39 | Line 40 | namespace RomCheater.CheatPlugin
40  
41          public override void Config()
42          {
43 <            Logging.logger.Warn.WriteLine("This plugin has no configurable settings.");
43 >            Logging.logger.Warn.WriteLine("Plugin: '{0}' guid: '{1}' - has no configurable settings", name, ID);
44          }
45  
46 <        public override void Show()
46 >        public override void Show() { Show(null); }
47 >        public override void Show(DockPanel dockPanel) { Show(dockPanel, DockState.Document); }
48 >        public override void Show(DockPanel dockPanel, DockState dockState) { InternalShow(dockPanel, dockState); }
49 >        private void InternalShow(DockPanel dockPanel, DockState dockState)
50          {
51 + #if PLUGIN_ENABLED
52              var t = new CheatCodeDockContent();
53 <            t.Show();
54 <        }
55 <        public override void Show(DockPanel dockPanel)
56 <        {
57 <            var t = new CheatCodeDockContent();
58 <            t.Show(dockPanel);
59 <        }
60 <        public override void Show(DockPanel dockPanel, DockState dockState)
61 <        {
62 <            var t = new CheatCodeDockContent();
63 <            t.Show(dockPanel, dockState);
53 >            if (dockPanel == null)
54 >            {
55 >                t.Show();
56 >            }
57 >            else
58 >            {
59 >                t.Show(dockPanel, dockState);
60 >            }
61 > #else
62 >            Logging.logger.Warn.WriteLine("Plugin: '{0}' guid: '{1}' - is currently disabled", name, ID);
63 > #endif
64          }
65      }
66   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines