private void DoSetTemposLibrary(string[] tokens) { if (tokens.Length == 1) { PrintLine(ConfigurationManager.UseKeyboardHook ? Types.Strings.ShellKeyboardLockStatusOn : Types.Strings.ShellKeyboardLockStatusOff); return; } if ((tokens[1].ToLower().Equals("on")) || (tokens[1].ToLower().Equals("true"))) { if (!ConfigurationManager.UseKeyboardHook) { ConfigurationManager.SetUseKeyboardHook(true); UserControlManager.Enable(); } PrintLine(Types.Strings.ShellKeyboardLockStatusOn); } else if ((tokens[1].ToLower().Equals("off")) || (tokens[1].ToLower().Equals("false"))) { if (ConfigurationManager.UseKeyboardHook) { ConfigurationManager.SetUseKeyboardHook(false); UserControlManager.Disable(); } PrintLine(Types.Strings.ShellKeyboardLockStatusOff); } }
private void radioButtonIsNotKeyboardRestricted_SelectionGained(object sender, EventArgs e) { if (!IsInitialized) { return; } ConfigurationManager.SetUseKeyboardHook(false); #if !DEBUG UserControlManager.Disable(); UserControlManager.Enable(false); #endif radioButtonIsKeyboardRestricted.IsSelected = false; }
/// <summary> /// Called when all startup conditions have been meet. The database is now /// accessible as well. /// </summary> private void FinalStartUp() { if ((_notification != null) && _notification.IsLoaded && _notification.IsVisible) { _notification.Close(); } // Disable AlwaysUseDefaults which was being used prior to this... ConfigurationManager.AlwaysUseDefaults = false; // Task Manager Protection // SettingManager.SetStoreSetting("DontDisableTaskManager", 0); int?isDisabled = SettingManager.GetInt32("DontDisableTaskManager"); if (isDisabled.HasValue && (isDisabled.Value == 1)) { BeginStartup(); return; } if (!TaskManagerServiceHelper.IsInstalled) { if (PosDialogWindow.ShowDialog(Types.Strings.DoYouWantToInstallTheTaskManagerAccessService, Types.Strings.InstallService, DialogButtons.YesNo, false) == DialogButton.Yes) { new Thread(TaskManagerServiceHelper.InstallThread).Start(); } } else if (!TaskManagerServiceHelper.IsStarted) { if (PosDialogWindow.ShowDialog(Types.Strings.DoYouWantToStartTheTaskManagerAccessService, Types.Strings.StartService, DialogButtons.YesNo, false) == DialogButton.Yes) { new Thread(TaskManagerServiceHelper.StartThread).Start(); } } else { TaskManagerServiceHelper.IsTaskManagerDisabled = true; } // Install the SQL Assembly (if one is pending installation) if (Updater.InstallSQLAssembly()) { #if DEBUG PosDialogWindow.ShowDialog("New SQL Assembly Installed", Types.Strings.Information); #endif } // Apply any required database patches at runtime SqlServerSetup.ApplyDatabasePatches(); // Check to make sure the model classes and the tables match if (!DataModelBase.ValidateDatabase()) { #if DEBUG string results = DataModelBase.InvalidDatabaseReport(); PosDialogWindow.ShowDialog( results, "Invalid Database Report"); #else PosDialogWindow.ShowDialog( Strings.TheDatabaseDesignCurrentlyBeingUsedIsIncorrectForThisVersionOfTempos, Strings.StartupError); #endif UserControlManager.ShowTaskbar(true); Application.Current.Shutdown(); return; } // Enable user control UserControlManager.Enable(ConfigurationManager.UseKeyboardHook); UserControlManager.ShowTaskbar(false); // Start-up MainWindow Show(); _mainWindow = new MainWindow(); _mainWindow.Show(); }