ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/RomCheater/trunk/RomCheater/Docking/MemorySearch/AddressValuePairList.cs
(Generate patch)

Comparing trunk/RomCheater/Docking/MemorySearch/AddressValuePairList.cs (file contents):
Revision 242 by william, Sun Jun 3 12:47:06 2012 UTC vs.
Revision 243 by william, Sun Jun 3 13:21:51 2012 UTC

--- trunk/RomCheater/Docking/MemorySearch/AddressValuePairList.cs	2012/06/03 13:04:02	242
+++ trunk/RomCheater/Docking/MemorySearch/AddressValuePairList.cs	2012/06/03 13:21:51	243
@@ -10,13 +10,24 @@ using Utilities.TransparentControls.List
 using System.IO;
 using RomCheater.Logging;
 using RomCheater.Docking.MemorySearch;
+using Sojaner.MemoryScanner.MemoryProviers;
+using System.Diagnostics;
+using RomCheater.PluginFramework.Interfaces;
 
 namespace System.Windows.Forms
 {
     [Serializable]
-    public partial class AddressValuePairList : dbufferedListView, IAvpExport, IAvpImport, IAvpLvSupport, IAvpLvColumnSupport, IAvpFreeze
+    public partial class AddressValuePairList : 
+        dbufferedListView, IAvpExport, IAvpImport, IAvpLvSupport, IAvpLvColumnSupport, IAvpFreeze,
+        IAcceptsProcess<Process>,
+        IAcceptsPlugin<IConfigPlugin>
     {
-
+        #region IAcceptsProcess<Process> Members
+        public Process AcceptedProcess { get; set; }
+        #endregion
+        #region IAcceptsPlugin<IConfigPlugin> Members
+        public IConfigPlugin AcceptedPlugin { get; set; }
+        #endregion
 
         public class AddressValuePairListSorter : System.Collections.IComparer
         {
@@ -147,6 +158,8 @@ namespace System.Windows.Forms
 
             this.ColumnClick += new ColumnClickEventHandler(AddressValuePairList_ColumnClick);
 
+            this.AcceptedPlugin = null;
+            this.AcceptedProcess = null;
 
         }
 
@@ -470,27 +483,27 @@ namespace System.Windows.Forms
                 {
                     iter = (ResultItem)this.Items[index];
                 }
-                Sojaner.MemoryScanner.ProcessMemoryReader writer = new Sojaner.MemoryScanner.ProcessMemoryReader();                
+                GenericMemoryProvider provider = new GenericMemoryProvider((IAcceptsProcessAndConfig)this);            
                 ResultDataType result = (ResultDataType)iter.Tag;
                 uint Address = result.Address;
                 byte[] bitData = new byte[] { };
                 switch (result.ValueType)
                 {
                     case SearchDataTypes._8bits:
-                        if (result.IsUnsigned) { writer.PatchMemory(Address, Convert.ToByte(result.Value)); }
-                        else { writer.PatchMemory(Address, Convert.ToSByte(result.Value)); }
+                        if (result.IsUnsigned) { provider.PatchMemory(Address, Convert.ToByte(result.Value)); }
+                        else { provider.PatchMemory(Address, Convert.ToSByte(result.Value)); }
                         break;
                     case SearchDataTypes._16bits:
-                        if (result.IsUnsigned) { writer.PatchMemory(Address, Convert.ToUInt16(result.Value)); }
-                        else { writer.PatchMemory(Address, Convert.ToInt16(result.Value)); }
+                        if (result.IsUnsigned) { provider.PatchMemory(Address, Convert.ToUInt16(result.Value)); }
+                        else { provider.PatchMemory(Address, Convert.ToInt16(result.Value)); }
                         break;
                     case SearchDataTypes._32bits:
-                        if (result.IsUnsigned) { writer.PatchMemory(Address, Convert.ToUInt32(result.Value)); }
-                        else { writer.PatchMemory(Address, Convert.ToInt32(result.Value)); }
+                        if (result.IsUnsigned) { provider.PatchMemory(Address, Convert.ToUInt32(result.Value)); }
+                        else { provider.PatchMemory(Address, Convert.ToInt32(result.Value)); }
                         break;
                     case SearchDataTypes._64bits:
-                        if (result.IsUnsigned) { writer.PatchMemory(Address, Convert.ToUInt64(result.Value)); }
-                        else { writer.PatchMemory(Address, Convert.ToInt64(result.Value)); }
+                        if (result.IsUnsigned) { provider.PatchMemory(Address, Convert.ToUInt64(result.Value)); }
+                        else { provider.PatchMemory(Address, Convert.ToInt64(result.Value)); }
                         break;
                 }
             }