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); } } }
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); } } }
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); }