/[RomCheater]/trunk/RomCheater.PluginFramework/Core/ScratchPadPlugin.cs
ViewVC logotype

Annotation of /trunk/RomCheater.PluginFramework/Core/ScratchPadPlugin.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 674 - (hide annotations) (download)
Mon Jun 17 05:41:23 2013 UTC (7 years, 5 months ago) by william
File size: 2480 byte(s)
+ add a scratchpad plugin

1 william 674 #region Logging Defines
2     // include this any class or method that required logging, and comment-out what is not needed
3     #define LOGGING_ENABLED // this is only valid within the logger class
4     #region Enabled logging levels
5     #define LOGGING_ENABLE_INFO
6     #define LOGGING_ENABLE_WARN
7     #define LOGGING_ENABLE_DEBUG
8     #define LOGGING_ENABLE_VERBOSEDEBUG
9     #define LOGGING_ENABLE_ERROR
10     #define LOGGING_ENABLE_VERBOSEERROR
11     #define LOGGING_ENABLE_PROFILER
12     #endregion
13     #endregion
14    
15     #define PLUGIN_ENABLED // when defined the plugin is enabled, otherwise it will not be shown
16     using System;
17     using System.Collections.Generic;
18     using System.Linq;
19     using System.Text;
20     using RomCheater.PluginFramework.Core;
21     using WeifenLuo.WinFormsUI.Docking;
22    
23     namespace RomCheater.PluginFramework.Core
24     {
25     public class ScratchPadPlugin : UserControlPlugin
26     {
27     const string name = "ScratchPad Plugin";
28     const string description = "A simple plugin to scratch crap down on";
29     public ScratchPadPlugin() : base() { }
30     public override Guid ID
31     {
32     get { return AssemblyGuid.GetGuid(typeof(ScratchPadPlugin)); }
33     //get { return new Guid(); }
34     }
35     public override string Name
36     {
37     get
38     {
39     return name;
40     }
41     }
42     public override string Description
43     {
44     get
45     {
46     return description;
47     }
48     }
49     public override void Reload(bool silent)
50     {
51     }
52    
53     public override void Config()
54     {
55     Logging.logger.Warn.WriteLine("Plugin: '{0}' guid: '{1}' - has no configurable settings", name, ID);
56     }
57    
58     public override void Show() { Show(null); }
59     public override void Show(DockPanel dockPanel) { Show(dockPanel, DockState.Document); }
60     public override void Show(DockPanel dockPanel, DockState dockState) { InternalShow(dockPanel, dockState); }
61     private void InternalShow(DockPanel dockPanel, DockState dockState)
62     {
63     #if PLUGIN_ENABLED
64     var t = new ScratchPad();
65     if (dockPanel == null)
66     {
67     t.Show();
68     }
69     else
70     {
71     t.Show(dockPanel, dockState);
72     }
73     #else
74     Logging.logger.Warn.WriteLine("Plugin: '{0}' guid: '{1}' - is currently disabled", name, ID);
75     #endif
76     }
77     }
78     }

  ViewVC Help
Powered by ViewVC 1.1.22