/[RomCheater]/trunk/RomCheater/Docking/FloatingMemorySearcher.cs
ViewVC logotype

Diff of /trunk/RomCheater/Docking/FloatingMemorySearcher.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- trunk/RomCheater/Docking/FloatingMemorySearcher.cs	2012/06/03 21:41:19	274
+++ trunk/RomCheater/Docking/FloatingMemorySearcher.cs	2012/06/03 22:01:05	275
@@ -16,6 +16,7 @@
 using RomCheater.Logging;
 using System.IO;
 using Sojaner.MemoryScanner.MemoryProviers;
+using RomCheater.PluginFramework.Events;
 
 namespace RomCheater.Docking
 {
@@ -23,7 +24,8 @@
        IAcceptsPlugin<IConfigPlugin>,
         IAcceptsProcess<Process>,
         IAcceptsProcessAndConfig,
-        ISearchInProgress
+        ISearchInProgress,
+        IAcceptsBrowseMemoryRegion
     {
         private bool DefaultUnsignedState = true; // set unsigned to true
         public FloatingMemorySearcher() { InitializeComponent(); this.AcceptedPlugin = null; this.AcceptedProcess = null; SearchInProgess = false; Reload(); }
@@ -38,6 +40,10 @@
         private IConfigPlugin _AcceptedPlugin;
         public IConfigPlugin AcceptedPlugin { get { return _AcceptedPlugin; } set { _AcceptedPlugin = value; UpdateAcceptedProcessAndConfig(value, AcceptedProcess); } }
         #endregion
+        #region IAcceptsBrowseMemoryRegion members
+        public BaseEventHandler<BrowseMemoryRegionEvent> OnBrowseMemoryRegion { get; set; }
+        #endregion
+
         private void UpdateAcceptedProcessAndConfig(IConfigPlugin config, Process process)
         {
             this.lstResults.AcceptedPlugin = config;
@@ -944,5 +950,40 @@
             btnSearch.Enabled = true;
             btnReset.Enabled = true;
         }
+
+        private void mnuItemPatchListViewMemoryRegion_Click(object sender, EventArgs e)
+        {
+            List<ResultDataType> patch_list = new List<ResultDataType>();
+            List<int> SelectedIndexes = new List<int>();
+            foreach (int index in lstPatchList.SelectedIndices) { SelectedIndexes.Add(index); }
+            foreach (int index in SelectedIndexes)
+            {
+                ListViewItem item = lstPatchList.Items[index];
+                ResultDataType rdt = (ResultDataType)item.Tag;
+                ViewMemoryRegion(rdt);
+                break; // only get the fist item
+            }
+        }
+
+        private void mnuItemResultsListViewMemoryRegion_Click(object sender, EventArgs e)
+        {
+            List<ResultDataType> patch_list = new List<ResultDataType>();
+            List<int> SelectedIndexes = new List<int>();
+            foreach (int index in lstResults.SelectedIndices) { SelectedIndexes.Add(index); }
+            foreach (int index in SelectedIndexes)
+            {
+                ListViewItem item = lstResults.Items[index];
+                ResultDataType rdt = (ResultDataType)item.Tag;
+                ViewMemoryRegion(rdt);
+                break; // only get the fist item
+            }
+        }
+        private void ViewMemoryRegion(ResultDataType rdt)
+        {
+            if (OnBrowseMemoryRegion != null)
+            {
+                OnBrowseMemoryRegion(new BrowseMemoryRegionEvent(rdt.Address));
+            }
+        }
     }
 }

 

  ViewVC Help
Powered by ViewVC 1.1.22