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

Comparing trunk/RomCheater/Docking/FloatingMemorySearcher.cs (file contents):
Revision 274 by william, Sun Jun 3 21:25:47 2012 UTC vs.
Revision 275 by william, Sun Jun 3 22:01:05 2012 UTC

# Line 16 | Line 16 | using System.Threading;
16   using RomCheater.Logging;
17   using System.IO;
18   using Sojaner.MemoryScanner.MemoryProviers;
19 + using RomCheater.PluginFramework.Events;
20  
21   namespace RomCheater.Docking
22   {
# Line 23 | Line 24 | namespace RomCheater.Docking
24         IAcceptsPlugin<IConfigPlugin>,
25          IAcceptsProcess<Process>,
26          IAcceptsProcessAndConfig,
27 <        ISearchInProgress
27 >        ISearchInProgress,
28 >        IAcceptsBrowseMemoryRegion
29      {
30          private bool DefaultUnsignedState = true; // set unsigned to true
31          public FloatingMemorySearcher() { InitializeComponent(); this.AcceptedPlugin = null; this.AcceptedProcess = null; SearchInProgess = false; Reload(); }
# Line 38 | Line 40 | namespace RomCheater.Docking
40          private IConfigPlugin _AcceptedPlugin;
41          public IConfigPlugin AcceptedPlugin { get { return _AcceptedPlugin; } set { _AcceptedPlugin = value; UpdateAcceptedProcessAndConfig(value, AcceptedProcess); } }
42          #endregion
43 +        #region IAcceptsBrowseMemoryRegion members
44 +        public BaseEventHandler<BrowseMemoryRegionEvent> OnBrowseMemoryRegion { get; set; }
45 +        #endregion
46 +
47          private void UpdateAcceptedProcessAndConfig(IConfigPlugin config, Process process)
48          {
49              this.lstResults.AcceptedPlugin = config;
# Line 944 | Line 950 | namespace RomCheater.Docking
950              btnSearch.Enabled = true;
951              btnReset.Enabled = true;
952          }
953 +
954 +        private void mnuItemPatchListViewMemoryRegion_Click(object sender, EventArgs e)
955 +        {
956 +            List<ResultDataType> patch_list = new List<ResultDataType>();
957 +            List<int> SelectedIndexes = new List<int>();
958 +            foreach (int index in lstPatchList.SelectedIndices) { SelectedIndexes.Add(index); }
959 +            foreach (int index in SelectedIndexes)
960 +            {
961 +                ListViewItem item = lstPatchList.Items[index];
962 +                ResultDataType rdt = (ResultDataType)item.Tag;
963 +                ViewMemoryRegion(rdt);
964 +                break; // only get the fist item
965 +            }
966 +        }
967 +
968 +        private void mnuItemResultsListViewMemoryRegion_Click(object sender, EventArgs e)
969 +        {
970 +            List<ResultDataType> patch_list = new List<ResultDataType>();
971 +            List<int> SelectedIndexes = new List<int>();
972 +            foreach (int index in lstResults.SelectedIndices) { SelectedIndexes.Add(index); }
973 +            foreach (int index in SelectedIndexes)
974 +            {
975 +                ListViewItem item = lstResults.Items[index];
976 +                ResultDataType rdt = (ResultDataType)item.Tag;
977 +                ViewMemoryRegion(rdt);
978 +                break; // only get the fist item
979 +            }
980 +        }
981 +        private void ViewMemoryRegion(ResultDataType rdt)
982 +        {
983 +            if (OnBrowseMemoryRegion != null)
984 +            {
985 +                OnBrowseMemoryRegion(new BrowseMemoryRegionEvent(rdt.Address));
986 +            }
987 +        }
988      }
989   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines