#region Logging Defines // include this any class or method that required logging, and comment-out what is not needed #define LOGGING_ENABLED // this is only valid within the logger class #region Enabled logging levels #define LOGGING_ENABLE_INFO #define LOGGING_ENABLE_WARN #define LOGGING_ENABLE_DEBUG #define LOGGING_ENABLE_VERBOSEDEBUG #define LOGGING_ENABLE_ERROR #define LOGGING_ENABLE_VERBOSEERROR #define LOGGING_ENABLE_PROFILER #endregion #endregion #define PLUGIN_ENABLED // when defined the plugin is enabled, otherwise it will not be shown using System; using System.Collections.Generic; using System.Linq; using System.Text; using RomCheater.PluginFramework.Core; using WeifenLuo.WinFormsUI.Docking; using Enterprise.Logging; namespace RomCheater.EmuMMAPPlugin { public class EmuMMAPPlugin : UserControlPlugin { EmuMEMMapDockControl t; const string name = "Emulator Memory Map Plugin"; const string description = "A simple plugin to display various the memory map for various emulator(s)/device(s)"; public EmuMMAPPlugin() : base() { t = new EmuMEMMapDockControl(this); } public override Guid ID { get { return AssemblyGuid.GetGuid(typeof(EmuMMAPPlugin)); } //get { return new Guid(); } } public override string Name { get { return name; } } public override string Description { get { return description; } } public override void Reload(bool silent) { } public override void Config() { gLog.Warn.WriteLine("Plugin: '{0}' guid: '{1}' - has no configurable settings", name, ID); } public override void Show() { Show(null); } public override void Show(DockPanel dockPanel) { Show(dockPanel, DockState.Document); } public override void Show(DockPanel dockPanel, DockState dockState) { InternalShow(dockPanel, dockState); } private void InternalShow(DockPanel dockPanel, DockState dockState) { #if PLUGIN_ENABLED if (dockPanel == null) { t.Show(); } else { t.Show(dockPanel, dockState); } #else 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; } } } }