/[RomCheater]/trunk/RomCheater/Main.cs
ViewVC logotype

Diff of /trunk/RomCheater/Main.cs

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

--- trunk/RomCheater/Main.cs	2012/05/28 10:37:53	195
+++ trunk/RomCheater/Main.cs	2012/05/31 05:52:41	196
@@ -18,18 +18,20 @@
 using RomCheater.Docking;
 using System.IO;
 using Sojaner.MemoryScanner;
+using RomCheater.PluginFramework.Events;
 
 namespace RomCheater
 {
     public partial class Main : Form
     {
         private bool m_bSaveLayout = true;
-        private Process SelectedProcess = null;
+        private Process SelectedProcess = null;        
         private DeserializeDockContent m_deserializeDockContent;
         private FloatingLogWindow m_LogWindow = new FloatingLogWindow();
         private FloatingAboutBox m_AboutBox = new FloatingAboutBox();
         private FloatingRamDumperDialog m_RamDump = new FloatingRamDumperDialog();
         private PIDSelector m_PIDSelector = new PIDSelector();
+        private FloatingMemoryView m_memoryview = new FloatingMemoryView();
         //private bool log_window_expanded = false;
         //private double log_window_splitter_default_position = 1.4045;
         PluginLoader loader = null;
@@ -48,10 +50,14 @@
         #endregion
 
 
-        private void OnProcessChanged(object sender, ProcessChangedEventArgs e)
+        private void OnProcessChanged(ProcessChangedEventArgs e)
         {
             SelectedProcess = Process.GetProcessById(e.ProcessID);
             m_RamDump.AcceptedProcess = SelectedProcess;
+            m_RamDump.AcceptedPlugin = this.ConfigPlugin;
+
+            m_memoryview.AcceptedProcess = SelectedProcess;
+            m_memoryview.AcceptedPlugin = this.ConfigPlugin;
         }
 
         #region Dock Support
@@ -73,6 +79,10 @@
             {
                 return m_PIDSelector;
             }
+            if (persistString == typeof(FloatingMemoryView).ToString())
+            {
+                return m_memoryview;
+            }
             else
             {
                 // not sure if this is appropriate
@@ -85,7 +95,8 @@
             m_AboutBox = new FloatingAboutBox();
             m_RamDump = new FloatingRamDumperDialog();
             m_PIDSelector = new PIDSelector();
-            m_PIDSelector.OnSelectedProcessChanged += new EventHandler<ProcessChangedEventArgs>(OnProcessChanged);
+            m_PIDSelector.OnSelectedProcessChanged += new BaseEventHandler<ProcessChangedEventArgs>(OnProcessChanged);
+            m_memoryview = new FloatingMemoryView();
             m_deserializeDockContent = new DeserializeDockContent(GetContentFromPersistString);
         }
         public void ShowDocks()
@@ -93,6 +104,7 @@
             ShowLogWindow();
             //ShowAboutBox();
             ShowRamDump();
+            ShowMemoryView();
             ShowPidSelector();
         }
         public void ShowLogWindow()
@@ -106,14 +118,18 @@
         public void ShowRamDump()
         {
             m_RamDump = new FloatingRamDumperDialog(ConfigPlugin);
-            m_RamDump.Show(dockPanel);
-            
+            m_RamDump.Show(dockPanel);            
+        }
+        public void ShowMemoryView()
+        {
+            m_memoryview = new FloatingMemoryView(ConfigPlugin);
+            m_memoryview.Show(dockPanel);
         }
         public void ShowPidSelector()
         {
             //List<Process> procs = ConfigPlugin.ValidProcessesForPlugin;
             m_PIDSelector = new PIDSelector(ConfigPlugin);
-            m_PIDSelector.OnSelectedProcessChanged += new EventHandler<ProcessChangedEventArgs>(OnProcessChanged);
+            m_PIDSelector.OnSelectedProcessChanged += new BaseEventHandler<ProcessChangedEventArgs>(OnProcessChanged);
             m_PIDSelector.Show(dockPanel);
         }
         #endregion

 

  ViewVC Help
Powered by ViewVC 1.1.22