Beispiel #1
0
		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;
		}
Beispiel #2
0
        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);
        }
Beispiel #3
0
		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;
		}