ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/RomCheater/trunk/RomCheater.EmuMMAPPlugin/EmuMMAPPlugin.cs
Revision: 812
Committed: Tue Apr 15 14:52:10 2014 UTC (9 years, 5 months ago) by william
File size: 3193 byte(s)
Log Message:
+ update logging to use Enterpise.Logging -- more work is still needed

File Contents

# User Rev Content
1 william 627 #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 william 628 #define PLUGIN_ENABLED // when defined the plugin is enabled, otherwise it will not be shown
16 william 627 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 william 812 using Enterprise.Logging;
23 william 627
24     namespace RomCheater.EmuMMAPPlugin
25     {
26     public class EmuMMAPPlugin : UserControlPlugin
27     {
28 william 717 EmuMEMMapDockControl t;
29 william 627 const string name = "Emulator Memory Map Plugin";
30     const string description = "A simple plugin to display various the memory map for various emulator(s)/device(s)";
31 william 717 public EmuMMAPPlugin() : base() { t = new EmuMEMMapDockControl(this); }
32 william 627 public override Guid ID
33     {
34     get { return AssemblyGuid.GetGuid(typeof(EmuMMAPPlugin)); }
35     //get { return new Guid(); }
36     }
37     public override string Name
38     {
39     get
40     {
41     return name;
42     }
43     }
44     public override string Description
45     {
46     get
47     {
48     return description;
49     }
50     }
51     public override void Reload(bool silent)
52     {
53     }
54    
55     public override void Config()
56     {
57 william 812 gLog.Warn.WriteLine("Plugin: '{0}' guid: '{1}' - has no configurable settings", name, ID);
58 william 627 }
59    
60     public override void Show() { Show(null); }
61     public override void Show(DockPanel dockPanel) { Show(dockPanel, DockState.Document); }
62     public override void Show(DockPanel dockPanel, DockState dockState) { InternalShow(dockPanel, dockState); }
63     private void InternalShow(DockPanel dockPanel, DockState dockState)
64     {
65 william 717 #if PLUGIN_ENABLED
66 william 627 if (dockPanel == null)
67     {
68     t.Show();
69     }
70     else
71     {
72     t.Show(dockPanel, dockState);
73     }
74     #else
75     Logging.logger.Warn.WriteLine("Plugin: '{0}' guid: '{1}' - is currently disabled", name, ID);
76     #endif
77     }
78 william 717
79     public override void Activate()
80     {
81     DockContentHandler handler = this.DockHandler;
82     if (handler != null)
83     handler.Activate();
84     }
85     public override void Close()
86     {
87     DockContentHandler handler = this.DockHandler;
88     if (handler != null)
89     handler.Close();
90     }
91     public override DockContentHandler DockHandler
92     {
93     get
94     {
95     if (t == null || t.DockHandler == null) return null;
96     return t.DockHandler;
97     }
98     }
99 william 627 }
100     }