public bool Attach() { if (!CanAttach) return false; var classificationFormatMap = classificationFormatMapService.GetClassificationFormatMap(AppearanceCategoryConstants.UIMisc); var data = new AttachProcessVM(Dispatcher.CurrentDispatcher, DebuggerSettings.SyntaxHighlightAttach, classificationFormatMap, textElementProvider); var win = new AttachProcessDlg(); win.DataContext = data; win.Owner = appWindow.MainWindow; var res = win.ShowDialog(); data.Dispose(); if (res != true) return false; var processVM = data.SelectedProcess; if (processVM == null) return false; var options = new AttachProcessOptions(processVM.CLRTypeInfo); options.ProcessId = processVM.PID; options.DebugMessageDispatcher = WpfDebugMessageDispatcher.Instance; string errMsg; if (!Attach(options, out errMsg)) { if (!string.IsNullOrEmpty(errMsg)) messageBoxService.Show(errMsg); return false; } return true; }
public void Attach() { if (!CanAttach) return; var data = new AttachProcessVM(MainWindow.Instance.Dispatcher); var win = new AttachProcessDlg(); win.DataContext = data; win.Owner = MainWindow.Instance; var res = win.ShowDialog(); data.Dispose(); if (res != true) return; var processVM = data.SelectedProcess; if (processVM == null) return; var options = new AttachProcessOptions(processVM.CLRTypeInfo); options.ProcessId = processVM.PID; options.DebugMessageDispatcher = WpfDebugMessageDispatcher.Instance; Attach(options); }
public bool Attach() { if (!CanAttach) return false; var data = new AttachProcessVM(Dispatcher.CurrentDispatcher, debuggerSettings.SyntaxHighlightAttach); var win = new AttachProcessDlg(); win.DataContext = data; win.Owner = appWindow.MainWindow; var res = win.ShowDialog(); data.Dispose(); if (res != true) return false; var processVM = data.SelectedProcess; if (processVM == null) return false; var options = new AttachProcessOptions(processVM.CLRTypeInfo); options.ProcessId = processVM.PID; options.DebugMessageDispatcher = WpfDebugMessageDispatcher.Instance; string errMsg; if (!Attach(options, out errMsg)) { if (!string.IsNullOrEmpty(errMsg)) messageBoxManager.Show(errMsg); return false; } return true; }