/[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

revision 272 by william, Sun Jun 3 21:25:47 2012 UTC revision 275 by william, Sun Jun 3 22:01:05 2012 UTC
# Line 16  using System.Threading; Line 16  using System.Threading;
16  using RomCheater.Logging;  using RomCheater.Logging;
17  using System.IO;  using System.IO;
18  using Sojaner.MemoryScanner.MemoryProviers;  using Sojaner.MemoryScanner.MemoryProviers;
19    using RomCheater.PluginFramework.Events;
20    
21  namespace RomCheater.Docking  namespace RomCheater.Docking
22  {  {
# Line 23  namespace RomCheater.Docking Line 24  namespace RomCheater.Docking
24         IAcceptsPlugin<IConfigPlugin>,         IAcceptsPlugin<IConfigPlugin>,
25          IAcceptsProcess<Process>,          IAcceptsProcess<Process>,
26          IAcceptsProcessAndConfig,          IAcceptsProcessAndConfig,
27          ISearchInProgress          ISearchInProgress,
28            IAcceptsBrowseMemoryRegion
29      {      {
30          private bool DefaultUnsignedState = true; // set unsigned to true          private bool DefaultUnsignedState = true; // set unsigned to true
31          public FloatingMemorySearcher() { InitializeComponent(); this.AcceptedPlugin = null; this.AcceptedProcess = null; SearchInProgess = false; Reload(); }          public FloatingMemorySearcher() { InitializeComponent(); this.AcceptedPlugin = null; this.AcceptedProcess = null; SearchInProgess = false; Reload(); }
# Line 38  namespace RomCheater.Docking Line 40  namespace RomCheater.Docking
40          private IConfigPlugin _AcceptedPlugin;          private IConfigPlugin _AcceptedPlugin;
41          public IConfigPlugin AcceptedPlugin { get { return _AcceptedPlugin; } set { _AcceptedPlugin = value; UpdateAcceptedProcessAndConfig(value, AcceptedProcess); } }          public IConfigPlugin AcceptedPlugin { get { return _AcceptedPlugin; } set { _AcceptedPlugin = value; UpdateAcceptedProcessAndConfig(value, AcceptedProcess); } }
42          #endregion          #endregion
43            #region IAcceptsBrowseMemoryRegion members
44            public BaseEventHandler<BrowseMemoryRegionEvent> OnBrowseMemoryRegion { get; set; }
45            #endregion
46    
47          private void UpdateAcceptedProcessAndConfig(IConfigPlugin config, Process process)          private void UpdateAcceptedProcessAndConfig(IConfigPlugin config, Process process)
48          {          {
49              this.lstResults.AcceptedPlugin = config;              this.lstResults.AcceptedPlugin = config;
# Line 944  namespace RomCheater.Docking Line 950  namespace RomCheater.Docking
950              btnSearch.Enabled = true;              btnSearch.Enabled = true;
951              btnReset.Enabled = true;              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  }  }

Legend:
Removed from v.272  
changed lines
  Added in v.275

  ViewVC Help
Powered by ViewVC 1.1.22