public void ExitApplication() { if (isExiting) { return; } // Store project or handle cancel action by the user if (!StorageCommands.HandleUnsavedChanges()) { return; } isExiting = true; if (Application.Current != null) { Application.Current.Shutdown(); } }
/// <summary> /// Runs the user interface, causing all user interface components to initialize, /// loading plugins, opening a saved project and displaying the main window. /// </summary> /// <param name="projectPath">Optional: path to the project to be opened.</param> public void Run(string projectPath = null) { DateTime startTime = DateTime.Now; ConfigureLogging(); Initialize(); log.InfoFormat(Resources.GuiCore_Run_Started_in_0_f2_sec, (DateTime.Now - startTime).TotalSeconds); mainWindow.Show(); bool isPathGiven = !string.IsNullOrWhiteSpace(projectPath); if (isPathGiven) { StorageCommands.OpenExistingProject(projectPath); } MessageWindowLogAppender.Instance.Enabled = true; }