Exemple #1
0
        public override void Execute(object parameter)
        {
            if (!CurrentDebugger.IsDebugging)
            {
                if (DebuggerSettings.Instance.ShowWarnings)
                {
                    MessageBox.Show("Warning: When attaching to an application, some local variables might not be available. If possible, use the \"Start Executable\" command.",
                                    "Attach to a process", MessageBoxButton.OK, MessageBoxImage.Warning);
                }

                var window = new AttachToProcessWindow {
                    Owner = MainWindow.Instance
                };
                if (window.ShowDialog() == true)
                {
                    StartAttaching(window.SelectedProcess);
                }
            }
        }
Exemple #2
0
        public override void Execute(object parameter)
        {
            if (!CurrentDebugger.IsDebugging)
            {
                var      settings     = ILSpySettings.Load();
                XElement e            = settings["DebuggerSettings"];
                var      showWarnings = (bool?)e.Attribute("showWarnings");
                if ((showWarnings.HasValue && showWarnings.Value) || !showWarnings.HasValue)
                {
                    MessageBox.Show("Warning: When attaching to an application, some local variables might not be available. If possible, use the \"Start Executable\" command.",
                                    "Attach to a process", MessageBoxButton.OK, MessageBoxImage.Warning);
                }

                var window = new AttachToProcessWindow {
                    Owner = MainWindow.Instance
                };
                if (window.ShowDialog() == true)
                {
                    StartAttaching(window.SelectedProcess);
                }
            }
        }
Exemple #3
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);
        }