static void OnBeforeSolutionClosing(SolutionCancelEventArgs e) { if (BeforeSolutionClosing != null) { BeforeSolutionClosing(null, e); } }
/// <summary> /// Executes the OnBeforeSolutionClosing event. /// </summary> /// <remarks>This method must be used after CloseSolution is called.</remarks> /// <returns><c>true</c>, if closing solution was canceled; <c>false</c>, otherwise.</returns> internal static bool IsClosingCanceled() { // run onbefore closing var beforeClosingArgs = new SolutionCancelEventArgs(openSolution); OnBeforeSolutionClosing(beforeClosingArgs); return(beforeClosingArgs.Cancel); }
/// <summary> /// Executes the OnBeforeSolutionClosing event. /// </summary> /// <remarks>This method must be used after CloseSolution is called.</remarks> /// <returns><c>true</c>, if closing solution was canceled; <c>false</c>, otherwise.</returns> internal static bool IsClosingCanceled() { // run onbefore closing var beforeClosingArgs = new SolutionCancelEventArgs(openSolution); OnBeforeSolutionClosing(beforeClosingArgs); return beforeClosingArgs.Cancel; }
static void OnBeforeSolutionClosing(object sender, SolutionCancelEventArgs e) { if (currentDebugger == null) return; if (currentDebugger.IsDebugging) { string caption = StringParser.Parse("${res:XML.MainMenu.DebugMenu.Stop}"); string message = StringParser.Parse("${res:MainWindow.Windows.Debug.StopDebugging.Message}"); string[] buttonLabels = new string[] { StringParser.Parse("${res:Global.Yes}"), StringParser.Parse("${res:Global.No}") }; int result = MessageService.ShowCustomDialog(caption, message, 0, // yes 1, // no buttonLabels); if (result == 0) { currentDebugger.Stop(); } else { e.Cancel = true; } } }