PageRenderTime 50ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 0ms

/source2/VSIP/Cosmos.VS.Debug/MainWindow.xaml.cs

https://bitbucket.org/mvptracker/cosmos
C# | 71 lines | 60 code | 11 blank | 0 comment | 1 complexity | 5293b947c7d42c3ed2aee534b9d90fea MD5 | raw file
Possible License(s): BSD-2-Clause
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.IO.Pipes;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading;
  8. using System.Windows;
  9. using System.Windows.Controls;
  10. using System.Windows.Data;
  11. using System.Windows.Documents;
  12. using System.Windows.Input;
  13. using System.Windows.Media;
  14. using System.Windows.Media.Imaging;
  15. using System.Windows.Navigation;
  16. using System.Windows.Shapes;
  17. using System.Windows.Threading;
  18. using Cosmos.Compiler.Debug;
  19. namespace Cosmos.VS.Debug
  20. {
  21. public partial class MainWindow : Window
  22. {
  23. public MainWindow()
  24. {
  25. InitializeComponent();
  26. PipeThread.DataPacketReceived += new Action<byte, byte[]>(PipeThread_DataPacketReceived);
  27. var xServerThread = new Thread(PipeThread.ThreadStartServer);
  28. xServerThread.Start();
  29. }
  30. void PipeThread_DataPacketReceivedInvoke(byte aCommand, byte[] aData) {
  31. switch (aCommand) {
  32. case DwMsgType.Noop:
  33. break;
  34. case DwMsgType.Stack:
  35. break;
  36. case DwMsgType.Frame:
  37. break;
  38. case DwMsgType.Registers:
  39. uctlRegisters.Update(aData);
  40. break;
  41. case DwMsgType.Quit:
  42. Close();
  43. break;
  44. case DwMsgType.AssemblySource:
  45. uctlAsmSource.Update(aData);
  46. break;
  47. }
  48. }
  49. void PipeThread_DataPacketReceived(byte aCmd, byte[] aMsg) {
  50. Dispatcher.Invoke(DispatcherPriority.Normal,
  51. (Action)delegate() {
  52. PipeThread_DataPacketReceivedInvoke(aCmd, aMsg);
  53. }
  54. );
  55. }
  56. private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) {
  57. PipeThread.Stop();
  58. }
  59. }
  60. }