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

Diff of /trunk/RomCheater/Main.cs

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

revision 313 by william, Tue Jun 5 15:03:03 2012 UTC revision 314 by william, Tue Jun 5 15:17:41 2012 UTC
# Line 81  namespace RomCheater Line 81  namespace RomCheater
81          void AddDockToWindowList(object sender, EventArgs e)          void AddDockToWindowList(object sender, EventArgs e)
82          {          {
83              DockContent dc;              DockContent dc;
84              ObjectBinder.Bind(sender, out dc);                          ObjectBinder.Bind(sender, out dc);
85                ToolStripMenuItem tsmi = new ToolStripMenuItem(dc.Text);
86                tsmi.Name = dc.Name;
87                tsmi.Tag = dc;
88                tsmi.Click += new EventHandler(tsmi_Click);
89                mnuWindows.DropDownItems.Add(tsmi);
90            }
91    
92            void tsmi_Click(object sender, EventArgs e)
93            {
94                ToolStripMenuItem tsmi;
95                ObjectBinder.Bind(sender, out tsmi);
96                DockContent dc;
97                ObjectBinder.Bind(tsmi.Tag, out dc);
98                dc.Activate();
99          }          }
100          void RemoveDockFromWindowList(object sender, FormClosedEventArgs e)          void RemoveDockFromWindowList(object sender, FormClosedEventArgs e)
101          {          {
102              DockContent dc;              DockContent dc;
103              ObjectBinder.Bind(sender, out dc);                ObjectBinder.Bind(sender, out dc);
104                 mnuWindows.DropDownItems.RemoveByKey(dc.Name);
105          }          }
106          private IDockContent GetContentFromPersistString(string persistString)          private IDockContent GetContentFromPersistString(string persistString)
107          {          {
# Line 126  namespace RomCheater Line 141  namespace RomCheater
141              if (m_LogWindow == null) return;              if (m_LogWindow == null) return;
142              m_LogWindow.Shown += new EventHandler(AddDockToWindowList);              m_LogWindow.Shown += new EventHandler(AddDockToWindowList);
143              m_LogWindow.FormClosed += new FormClosedEventHandler(RemoveDockFromWindowList);              m_LogWindow.FormClosed += new FormClosedEventHandler(RemoveDockFromWindowList);
144                m_LogWindow.Activate();
145          }          }
146          private void SetupRamDumpWindowHandler()          private void SetupRamDumpWindowHandler()
147          {          {
148              if (m_RamDump == null) return;              if (m_RamDump == null) return;
149              m_RamDump.Shown += new EventHandler(AddDockToWindowList);              m_RamDump.Shown += new EventHandler(AddDockToWindowList);
150              m_RamDump.FormClosed += new FormClosedEventHandler(RemoveDockFromWindowList);              m_RamDump.FormClosed += new FormClosedEventHandler(RemoveDockFromWindowList);
151                m_RamDump.Activate();
152          }          }
153          private void SetupMemoryViewWindowHandler()          private void SetupMemoryViewWindowHandler()
154          {          {
155              if (m_memoryview == null) return;              if (m_memoryview == null) return;
156              m_memoryview.Shown += new EventHandler(AddDockToWindowList);              m_memoryview.Shown += new EventHandler(AddDockToWindowList);
157              m_memoryview.FormClosed += new FormClosedEventHandler(RemoveDockFromWindowList);              m_memoryview.FormClosed += new FormClosedEventHandler(RemoveDockFromWindowList);
158                m_memoryview.Activate();
159          }          }
160          private void SetupPIDSelectorWindowHandler()          private void SetupPIDSelectorWindowHandler()
161          {          {
162              if (m_PIDSelector == null) return;              if (m_PIDSelector == null) return;
163              m_PIDSelector.Shown += new EventHandler(AddDockToWindowList);              m_PIDSelector.Shown += new EventHandler(AddDockToWindowList);
164              m_PIDSelector.FormClosed += new FormClosedEventHandler(RemoveDockFromWindowList);              m_PIDSelector.FormClosed += new FormClosedEventHandler(RemoveDockFromWindowList);
165                m_PIDSelector.Activate();
166          }          }
167          private void SetupDataTypeConverterWindowHandler()          private void SetupDataTypeConverterWindowHandler()
168          {          {
169              if (m_typeconverter == null) return;              if (m_typeconverter == null) return;
170              m_typeconverter.Shown += new EventHandler(AddDockToWindowList);              m_typeconverter.Shown += new EventHandler(AddDockToWindowList);
171              m_typeconverter.FormClosed += new FormClosedEventHandler(RemoveDockFromWindowList);              m_typeconverter.FormClosed += new FormClosedEventHandler(RemoveDockFromWindowList);
172                m_typeconverter.Activate();
173          }          }
174          private void SetupMemorySearchWindowHandler()          private void SetupMemorySearchWindowHandler()
175          {          {
176              if (m_memsearcher == null) return;              if (m_memsearcher == null) return;
177              m_memsearcher.Shown += new EventHandler(AddDockToWindowList);              m_memsearcher.Shown += new EventHandler(AddDockToWindowList);
178              m_memsearcher.FormClosed += new FormClosedEventHandler(RemoveDockFromWindowList);              m_memsearcher.FormClosed += new FormClosedEventHandler(RemoveDockFromWindowList);
179                m_memsearcher.Activate();
180          }          }
181          #endregion          #endregion
182          public void ShowDocks()          public void ShowDocks()

Legend:
Removed from v.313  
changed lines
  Added in v.314

  ViewVC Help
Powered by ViewVC 1.1.22