Пример #1
0
        public static bool Attach()
        {
            if (DebuggerService.CurrentDebugger == null || DebuggerService.CurrentDebugger.IsDebugging)
            {
                return(false);
            }

            MainWindow.Instance.ShowIgnorableMessageBox("debug: attach warning",
                                                        "Warning: When attaching to an application, some local variables might not be available. If possible, use the \"Debug an Executable\" command.",
                                                        MessageBoxButton.OK);

            var window = new AttachToProcessWindow {
                Owner = MainWindow.Instance
            };

            if (window.ShowDialog() == true)
            {
                DebuggerPlugin.StartAttaching(window.SelectedProcess);
                return(true);
            }

            return(false);
        }