From beb587aea00d331b0a08c55f0cfd66abf11cda64 Mon Sep 17 00:00:00 2001 From: Sentinel209_cp <5b554accd9e292fcb886b205d8d4c32c5d52ce2df5Ng6vpx> Date: Wed, 13 Jul 2011 00:54:44 +0000 Subject: [PATCH] Added delayed updating of custom tool windows i fthey werent open when the breakpoint was hit. --- .../VSIP/Cosmos.VS.Windows/AssemblyUC.xaml.cs | 3 ++ .../Cosmos.VS.WindowsPackage.cs | 44 ++++++++++++++----- .../Cosmos.VS.Windows/RegistersUC.xaml.cs | 3 ++ .../VSIP/Cosmos.VS.Windows/StackUC.xaml.cs | 6 +++ 4 files changed, 46 insertions(+), 10 deletions(-) diff --git a/source2/VSIP/Cosmos.VS.Windows/AssemblyUC.xaml.cs b/source2/VSIP/Cosmos.VS.Windows/AssemblyUC.xaml.cs index 436772c57..17a98b909 100644 --- a/source2/VSIP/Cosmos.VS.Windows/AssemblyUC.xaml.cs +++ b/source2/VSIP/Cosmos.VS.Windows/AssemblyUC.xaml.cs @@ -18,12 +18,15 @@ using System.Threading; namespace Cosmos.Cosmos_VS_Windows { public partial class AssemblyUC : UserControl { + + public static byte[] mData; protected string mCode; public AssemblyUC() { InitializeComponent(); mitmCopy.Click += new RoutedEventHandler(mitmCopy_Click); + Update(mData); } void mitmCopy_Click(object sender, RoutedEventArgs e) { diff --git a/source2/VSIP/Cosmos.VS.Windows/Cosmos.VS.WindowsPackage.cs b/source2/VSIP/Cosmos.VS.Windows/Cosmos.VS.WindowsPackage.cs index 855557946..54b19b942 100644 --- a/source2/VSIP/Cosmos.VS.Windows/Cosmos.VS.WindowsPackage.cs +++ b/source2/VSIP/Cosmos.VS.Windows/Cosmos.VS.WindowsPackage.cs @@ -156,26 +156,44 @@ namespace Cosmos.Cosmos_VS_Windows break; case DwMsgType.Stack: - if (StackTW.mUC != null) { - StackTW.mUC.Dispatcher.Invoke(DispatcherPriority.Normal, (Action)delegate() { + if (StackTW.mUC != null) + { + StackTW.mUC.Dispatcher.Invoke(DispatcherPriority.Normal, (Action)delegate() + { StackTW.mUC.UpdateStack(xMsg); }); } + else + { + StackUC.mStackData = xMsg; + } break; case DwMsgType.Frame: - if (StackTW.mUC != null) { - StackTW.mUC.Dispatcher.Invoke(DispatcherPriority.Normal, (Action)delegate() { + if (StackTW.mUC != null) + { + StackTW.mUC.Dispatcher.Invoke(DispatcherPriority.Normal, (Action)delegate() + { StackTW.mUC.UpdateFrame(xMsg); }); } + else + { + StackUC.mFrameData = xMsg; + } break; case DwMsgType.Registers: - if (RegistersTW.mUC != null) { - RegistersTW.mUC.Dispatcher.Invoke(DispatcherPriority.Normal, (Action)delegate() { - RegistersTW.mUC.Update(xMsg); - }); + if (RegistersTW.mUC != null) + { + RegistersTW.mUC.Dispatcher.Invoke(DispatcherPriority.Normal, (Action)delegate() + { + RegistersTW.mUC.Update(xMsg); + }); + } + else + { + RegistersUC.mData = xMsg; } break; @@ -184,11 +202,17 @@ namespace Cosmos.Cosmos_VS_Windows break; case DwMsgType.AssemblySource: - if (AssemblyTW.mUC != null) { - AssemblyTW.mUC.Dispatcher.Invoke(DispatcherPriority.Normal, (Action)delegate() { + if (AssemblyTW.mUC != null) + { + AssemblyTW.mUC.Dispatcher.Invoke(DispatcherPriority.Normal, (Action)delegate() + { AssemblyTW.mUC.Update(xMsg); }); } + else + { + AssemblyUC.mData = xMsg; + } break; } } diff --git a/source2/VSIP/Cosmos.VS.Windows/RegistersUC.xaml.cs b/source2/VSIP/Cosmos.VS.Windows/RegistersUC.xaml.cs index 56f96daa0..8ce28da1a 100644 --- a/source2/VSIP/Cosmos.VS.Windows/RegistersUC.xaml.cs +++ b/source2/VSIP/Cosmos.VS.Windows/RegistersUC.xaml.cs @@ -20,8 +20,11 @@ namespace Cosmos.Cosmos_VS_Windows { public partial class RegistersUC : UserControl { + public static byte[] mData; + public RegistersUC() { InitializeComponent(); + Update(mData); } protected void UpdateRegisters(byte[] aData, int aOffset, DataBytesUC a32, DataBytesUC a16, DataBytesUC a8Hi, DataBytesUC a8Lo) diff --git a/source2/VSIP/Cosmos.VS.Windows/StackUC.xaml.cs b/source2/VSIP/Cosmos.VS.Windows/StackUC.xaml.cs index 3f0637a15..e4754502f 100644 --- a/source2/VSIP/Cosmos.VS.Windows/StackUC.xaml.cs +++ b/source2/VSIP/Cosmos.VS.Windows/StackUC.xaml.cs @@ -14,8 +14,14 @@ using System.Windows.Shapes; namespace Cosmos.Cosmos_VS_Windows { public partial class StackUC : UserControl { + + public static byte[] mFrameData; + public static byte[] mStackData; + public StackUC() { InitializeComponent(); + UpdateFrame(mFrameData); + UpdateStack(mStackData); } public void UpdateFrame(byte[] aData) {