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 |
|
|
|
23 |
|
|
namespace RomCheater.EmuMMAPPlugin |
24 |
|
|
{ |
25 |
|
|
public class EmuMMAPPlugin : UserControlPlugin |
26 |
|
|
{ |
27 |
william |
717 |
EmuMEMMapDockControl t; |
28 |
william |
627 |
const string name = "Emulator Memory Map Plugin"; |
29 |
|
|
const string description = "A simple plugin to display various the memory map for various emulator(s)/device(s)"; |
30 |
william |
717 |
public EmuMMAPPlugin() : base() { t = new EmuMEMMapDockControl(this); } |
31 |
william |
627 |
public override Guid ID |
32 |
|
|
{ |
33 |
|
|
get { return AssemblyGuid.GetGuid(typeof(EmuMMAPPlugin)); } |
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 |
627 |
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 |
627 |
} |
99 |
|
|
} |