/[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/06/05 14:17:14	312
+++ trunk/RomCheater/Main.cs	2012/06/05 15:03:03	313
@@ -78,6 +78,16 @@
         }
 
         #region Dock Support
+        void AddDockToWindowList(object sender, EventArgs e)
+        {
+            DockContent dc;
+            ObjectBinder.Bind(sender, out dc);            
+        }
+        void RemoveDockFromWindowList(object sender, FormClosedEventArgs e)
+        {
+            DockContent dc;
+            ObjectBinder.Bind(sender, out dc);  
+        }
         private IDockContent GetContentFromPersistString(string persistString)
         {
             if (persistString == typeof(FloatingLogWindow).ToString()) { return m_LogWindow; }
@@ -101,23 +111,75 @@
             m_memsearcher.OnBrowseMemoryRegion += new BaseEventHandler<BrowseMemoryRegionEvent>(OnBrowseMemoryRegion);
             m_deserializeDockContent = new DeserializeDockContent(GetContentFromPersistString);
         }
+        #region SetupDockWindowHandler support
+        public void SetupDockWindowHandler()
+        {
+            SetupLogWindowHandler();
+            SetupRamDumpWindowHandler();
+            SetupMemoryViewWindowHandler();
+            SetupPIDSelectorWindowHandler();
+            SetupDataTypeConverterWindowHandler();
+            SetupMemorySearchWindowHandler();
+        }
+        private void SetupLogWindowHandler()
+        {
+            if (m_LogWindow == null) return;
+            m_LogWindow.Shown += new EventHandler(AddDockToWindowList);
+            m_LogWindow.FormClosed += new FormClosedEventHandler(RemoveDockFromWindowList);
+        }
+        private void SetupRamDumpWindowHandler()
+        {
+            if (m_RamDump == null) return;
+            m_RamDump.Shown += new EventHandler(AddDockToWindowList);
+            m_RamDump.FormClosed += new FormClosedEventHandler(RemoveDockFromWindowList);
+        }
+        private void SetupMemoryViewWindowHandler()
+        {
+            if (m_memoryview == null) return;
+            m_memoryview.Shown += new EventHandler(AddDockToWindowList);
+            m_memoryview.FormClosed += new FormClosedEventHandler(RemoveDockFromWindowList);
+        }
+        private void SetupPIDSelectorWindowHandler()
+        {
+            if (m_PIDSelector == null) return;
+            m_PIDSelector.Shown += new EventHandler(AddDockToWindowList);
+            m_PIDSelector.FormClosed += new FormClosedEventHandler(RemoveDockFromWindowList);
+        }
+        private void SetupDataTypeConverterWindowHandler()
+        {
+            if (m_typeconverter == null) return;
+            m_typeconverter.Shown += new EventHandler(AddDockToWindowList);
+            m_typeconverter.FormClosed += new FormClosedEventHandler(RemoveDockFromWindowList);
+        }
+        private void SetupMemorySearchWindowHandler()
+        {
+            if (m_memsearcher == null) return;
+            m_memsearcher.Shown += new EventHandler(AddDockToWindowList);
+            m_memsearcher.FormClosed += new FormClosedEventHandler(RemoveDockFromWindowList);
+        }
+        #endregion
         public void ShowDocks()
         {
             ShowLogWindow();
+            SetupLogWindowHandler();
             //ShowAboutBox();
             ShowRamDump();
+            SetupRamDumpWindowHandler();
             ShowMemoryView();
+            SetupMemoryViewWindowHandler();
             ShowPidSelector();
+            SetupPIDSelectorWindowHandler();
             ShowDataTypeConverter();
+            SetupDataTypeConverterWindowHandler();
             ShowMemorySearch();
+            SetupMemorySearchWindowHandler();
         }
         public void ShowLogWindow()
         {
             if (m_LogWindow == null || m_LogWindow.IsDisposed) { m_LogWindow = new FloatingLogWindow(); }
             LoggerInstance = m_LogWindow.Logwriter;
             LoggerInstance.CreateNewLog(false);
-            m_LogWindow.Show(dockPanel, DockState.DockBottom);
-
+            m_LogWindow.Show(dockPanel, DockState.DockBottom);       
         }
         public void ShowAboutBox()
         {
@@ -129,8 +191,8 @@
             load_plugins();
             m_RamDump = new FloatingRamDumperDialog(ConfigPlugin);
             m_RamDump.AcceptedProcess = SelectedProcess;
-            m_RamDump.Show(dockPanel);            
-        }
+            m_RamDump.Show(dockPanel);
+        }       
         public void ShowMemoryView()
         {
             load_plugins();
@@ -149,7 +211,7 @@
         public void ShowDataTypeConverter()
         {
             if (m_typeconverter == null || m_typeconverter.IsDisposed) { m_typeconverter = new FloatingDataTypeConverter(); }
-            m_typeconverter.Show(dockPanel, DockState.DockRightAutoHide);
+            m_typeconverter.Show(dockPanel, DockState.DockRightAutoHide);            
         }
         public void ShowMemorySearch()
         {
@@ -159,6 +221,8 @@
             m_memsearcher.OnBrowseMemoryRegion += new BaseEventHandler<BrowseMemoryRegionEvent>(OnBrowseMemoryRegion);
             m_memsearcher.Show(dockPanel);
         }
+
+       
         #endregion
 
 
@@ -257,6 +321,7 @@
                 try
                 {
                     dockPanel.LoadFromXml(configFile, m_deserializeDockContent);
+                    SetupDockWindowHandler();
                 }
                 catch (Exception)
                 {

 

  ViewVC Help
Powered by ViewVC 1.1.22