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

Comparing trunk/RomCheater/Main.cs (file contents):
Revision 227 by william, Sat Jun 2 15:48:25 2012 UTC vs.
Revision 228 by william, Sat Jun 2 16:02:01 2012 UTC

--- trunk/RomCheater/Main.cs	2012/06/02 15:48:25	227
+++ trunk/RomCheater/Main.cs	2012/06/02 16:02:01	228
@@ -54,6 +54,13 @@ namespace RomCheater
 
         private void OnProcessChanged(ProcessChangedEventArgs e)
         {
+            if (m_memsearcher.SearchInProgess)
+            {
+                DialogResult result = MessageBox.Show("Do you want to start a new search with the selected process?", "A memory search is currently in progress", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button3);
+                if (result != DialogResult.Yes || result != DialogResult.OK) { return; }
+                m_memsearcher = null; //free memory used by the memory searcher
+                m_memsearcher = new FloatingMemorySearcher();
+            }
             SelectedProcess = Process.GetProcessById(e.ProcessID);
             m_RamDump.AcceptedProcess = SelectedProcess;
             m_RamDump.AcceptedPlugin = this.ConfigPlugin;
@@ -68,39 +75,13 @@ namespace RomCheater
         #region Dock Support
         private IDockContent GetContentFromPersistString(string persistString)
         {
-            if (persistString == typeof(FloatingLogWindow).ToString())
-            {
-                return m_LogWindow;
-            }
-            //if (persistString == typeof(FloatingAboutBox).ToString())
-            //{
-            //    return m_AboutBox;
-            //}
-            if (persistString == typeof(FloatingRamDumperDialog).ToString())
-            {
-                return m_RamDump;
-            }
-            if (persistString == typeof(PIDSelector).ToString())
-            {
-                return m_PIDSelector;
-            }
-            if (persistString == typeof(FloatingMemoryView).ToString())
-            {
-                return m_memoryview;
-            }
-            if (persistString == typeof(FloatingDataTypeConverter).ToString())
-            {
-                return m_typeconverter;
-            }
-            if (persistString == typeof(FloatingMemorySearcher).ToString())
-            {
-                return m_memsearcher;
-            }
-            else
-            {
-                // not sure if this is appropriate
-                return null;
-            }
+            if (persistString == typeof(FloatingLogWindow).ToString()) { return m_LogWindow; }
+            if (persistString == typeof(FloatingRamDumperDialog).ToString()) { return m_RamDump; }
+            if (persistString == typeof(PIDSelector).ToString()) { return m_PIDSelector; }
+            if (persistString == typeof(FloatingMemoryView).ToString()) { return m_memoryview; }
+            if (persistString == typeof(FloatingDataTypeConverter).ToString()) { return m_typeconverter; }
+            if (persistString == typeof(FloatingMemorySearcher).ToString()) { return m_memsearcher; }
+            else { return null; }
         }
         public void SetupDocks()
         {