--- trunk/RomCheater.PluginFramework/Core/ScratchPadPlugin.cs 2013/06/17 08:33:06 683 +++ trunk/RomCheater.PluginFramework/Core/ScratchPadPlugin.cs 2013/06/18 11:27:53 717 @@ -24,9 +24,10 @@ namespace RomCheater.PluginFramework.Cor { public class ScratchPadPlugin : UserControlPlugin { + ScratchPad t; const string name = "ScratchPad Plugin"; const string description = "A simple plugin to scratch crap down on"; - public ScratchPadPlugin() : base() { } + public ScratchPadPlugin() : base() { t = new ScratchPad(this); } public override Guid ID { get { return AssemblyGuid.GetGuid(typeof(ScratchPadPlugin)); } @@ -60,8 +61,7 @@ namespace RomCheater.PluginFramework.Cor public override void Show(DockPanel dockPanel, DockState dockState) { InternalShow(dockPanel, dockState); } private void InternalShow(DockPanel dockPanel, DockState dockState) { -#if PLUGIN_ENABLED - var t = new ScratchPad(this); +#if PLUGIN_ENABLED if (dockPanel == null) { t.Show(); @@ -74,5 +74,26 @@ namespace RomCheater.PluginFramework.Cor 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; + } + } } } |