private void UtilityWindowCommand_Executed(object sender, ExecutedRoutedEventArgs e) { // Force update of script interface UtilityWindowButton.Focus(); UtilityDialog = new UtilityWindow(Global.Setting.Interface.MonospacedFont) { Owner = this }; UtilityDialog.Show(); }
private async void Window_Closing(object sender, CancelEventArgs e) { if (Engine.WorkingEngine != null) { await Engine.WorkingEngine.ForceStopWait(); } if (0 < LogWindow.Count) { LogDialog.Close(); LogDialog = null; } if (0 < UtilityWindow.Count) { UtilityDialog.Close(); UtilityDialog = null; } if (0 < ScriptEditWindow.Count) { ScriptEditDialog.Close(); ScriptEditDialog = null; } // TODO: Do this in more cleaner way while (Model.ScriptRefreshing != 0) { await Task.Delay(500); } while (ScriptCache.DbLock != 0) { await Task.Delay(500); } if (Model.ProjectsLoading != 0) { await Task.Delay(500); } Global.ScriptCache?.WaitClose(); Logger.Db.Close(); }