public override void Attach(ShowAttachToProcessDialogOptions options) { var attachOptions = Show(options); foreach (var o in attachOptions) { dbgManager.Value.Start(o); } }
public override void Execute(IMenuItemContext context) { var options = new ShowAttachToProcessDialogOptions { ProcessType = "Unity", ProviderNames = new[] { PredefinedAttachProgramOptionsProviderNames.UnityEditor, PredefinedAttachProgramOptionsProviderNames.UnityPlayer, }, Message = dnSpy_Debugger_DotNet_Mono_Resources.AttachToUnityProcess_DebugBuildsOnlyMessage, InfoLink = new AttachToProcessLinkInfo { ToolTipMessage = DebuggingUnityGamesHelper.DebuggingUnityGamesText, Url = DebuggingUnityGamesHelper.DebuggingUnityGamesUrl, }, }; showAttachToProcessDialog.Value.Attach(options); }
public override AttachToProgramOptions[] Show(ShowAttachToProcessDialogOptions options) { AttachToProcessVM vm = null; try { var dlg = new AttachToProcessDlg(); vm = new AttachToProcessVM(options, uiDispatcher.Value, dbgManager.Value, debuggerSettings.Value, programFormatterProvider.Value, classificationFormatMapService, textElementProvider, attachProgramOptionsAggregatorFactory.Value, () => SearchHelp(vm, dlg)); dlg.DataContext = vm; dlg.Owner = appWindow.MainWindow; var res = dlg.ShowDialog(); if (res != true) { return(Array.Empty <AttachToProgramOptions>()); } return(vm.SelectedItems.Select(a => a.AttachProgramOptions.GetOptions()).ToArray()); } finally { vm?.Dispose(); } }
/// <summary> /// Shows the dialog box and attaches to the selected processes /// </summary> /// <param name="options">Options or null to use the default options</param> public abstract void Attach(ShowAttachToProcessDialogOptions options = null);
/// <summary> /// Shows the dialog box and returns the selected processes or an empty list /// </summary> /// <param name="options">Options or null to use the default options</param> /// <returns></returns> public abstract AttachToProgramOptions[] Show(ShowAttachToProcessDialogOptions options = null);