using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using WeifenLuo.WinFormsUI.Docking; using RomCheater.PluginFramework.Interfaces; using RomCheater.PluginFramework.Events; using System.Diagnostics; namespace RomCheater.Docking { public partial class FloatingMemoryView : DockContent, IProcessConfig, IAcceptsPlugin, IAcceptsExternalMemoryAddress { public FloatingMemoryView() { InitializeComponent(); this.AcceptedPlugin = null; this.AcceptedProcess = null; //this.MemoryStart = uint.MinValue; //this.MemorySize = uint.MaxValue; } public FloatingMemoryView(IConfigPlugin config) : this() { this.AcceptedPlugin = config; } public FloatingMemoryView(IConfigPlugin config, Process process) : this() { this.AcceptedPlugin = config; this.AcceptedProcess = process; } #region IProcessConfig Members public Process AcceptedProcess { get { return MemView.AcceptedProcess; } set { MemView.AcceptedProcess = value; } } #endregion #region IAcceptsPlugin Members public IConfigPlugin AcceptedPlugin { get { return MemView.AcceptedPlugin; } set { MemView.AcceptedPlugin = value; } } #endregion #region IAcceptsMemoryRange members private uint MemoryStart { get { return MemView.MemoryStart; } } private uint MemorySize { get { return MemView.MemorySize; } } #endregion #region IAcceptsExternalMemoryAddress public bool AcceptExternalMemoryAddress(uint address) { if (!((MemoryStart <= address) && (address <= (MemoryStart + MemorySize)))) { return false; } MemView.GotoAddress(address); return true; } #endregion } }