/[RomCheater]/trunk/RomCheater.RVACalculator/RVACalculatorPlugin.cs
ViewVC logotype

Annotation of /trunk/RomCheater.RVACalculator/RVACalculatorPlugin.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 717 - (hide annotations) (download)
Tue Jun 18 11:27:53 2013 UTC (7 years, 4 months ago) by william
File size: 3167 byte(s)

1 william 659 #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.RVACalculator
24     {
25     public class RVACalculatorPlugin : UserControlPlugin
26     {
27 william 717 private RVACalculatorDockControl t;
28 william 659 const string name = "RVA Calculator Plugin";
29     const string description = "A simple plugin to help calculate RVA values";
30 william 717 public RVACalculatorPlugin() : base() { t = new RVACalculatorDockControl(this); }
31 william 659 public override Guid ID
32     {
33     get { return AssemblyGuid.GetGuid(typeof(RVACalculatorPlugin)); }
34     //get { return new Guid(); }
35     }
36     public override string Name
37     {
38     get
39     {
40     return name;
41     }
42     }
43     public override string Description
44     {
45     get
46     {
47     return description;
48     }
49     }
50     public override void Reload(bool silent)
51     {
52     }
53    
54     public override void Config()
55     {
56     Logging.logger.Warn.WriteLine("Plugin: '{0}' guid: '{1}' - has no configurable settings", name, ID);
57     }
58    
59     public override void Show() { Show(null); }
60     public override void Show(DockPanel dockPanel) { Show(dockPanel, DockState.Document); }
61     public override void Show(DockPanel dockPanel, DockState dockState) { InternalShow(dockPanel, dockState); }
62     private void InternalShow(DockPanel dockPanel, DockState dockState)
63     {
64 william 717 #if PLUGIN_ENABLED
65 william 659 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 william 717
78     public override void Activate()
79     {
80     DockContentHandler handler = this.DockHandler;
81     if (handler != null)
82     handler.Activate();
83     }
84     public override void Close()
85     {
86     DockContentHandler handler = this.DockHandler;
87     if (handler != null)
88     handler.Close();
89     }
90     public override DockContentHandler DockHandler
91     {
92     get
93     {
94     if (t == null || t.DockHandler == null) return null;
95     return t.DockHandler;
96     }
97     }
98 william 659 }
99     }

  ViewVC Help
Powered by ViewVC 1.1.22