private static void Main() { if (AppCommon.OtherInstancesRunning()) { return; } Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); FileUtils.LogAssemblyInfo(); AppCommon.LoadGlobalSettings(); AppCommon.SetUserName(); AppCommon.SetProfileName(); if (!AppCommon.CreateUserAndProfile()) { return; } if (!AppCommon.LoadUserPreferences()) { return; } Log.SetupListeners(); CommandDescriptors.Init(); if (!AppCommon.SetCulture()) { return; } Common.PreInit(); Common.Init(); Splash splash = new Splash(1000); splash.Show(); splash.Close(); var form = new PreferencesCategoriesForm(); form.EvtLanguageChanged += form_EvtLanguageChanged; form.EvtThemeChanged += Form_EvtThemeChanged; Application.Run(form); }
public static void Main(String[] args) { if (AppCommon.OtherInstancesRunning()) { return; } Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); FileUtils.LogAssemblyInfo(); parseCommandLine(args); AppCommon.LoadGlobalSettings(); AppCommon.SetUserName(); AppCommon.SetProfileName(); if (!AppCommon.CreateUserAndProfile()) { return; } if (!AppCommon.LoadUserPreferences()) { return; } Common.AppPreferences.AppId = "ACATTalk"; Common.AppPreferences.AppName = "ACAT Talk"; if (!AppCommon.SetCulture()) { return; } Log.SetupListeners(); CommandDescriptors.Init(); setSwitchMapCommands(); Common.AppPreferences.PreferredPanelConfigNames = !String.IsNullOrEmpty(_panelConfig) ? _panelConfig : "TalkApplicationABC"; Splash splash = new Splash(1000); splash.Show(); Context.PreInit(); Common.PreInit(); Context.AppAgentMgr.EnableAppAgentContextSwitch = false; if (!Context.Init(Context.StartupFlags.Minimal | Context.StartupFlags.TextToSpeech | Context.StartupFlags.WordPrediction | Context.StartupFlags.AgentManager | Context.StartupFlags.WindowsActivityMonitor | Context.StartupFlags.Abbreviations)) { splash.Close(); splash = null; TimedMessageBox.Show(Context.GetInitCompletionStatus()); if (Context.IsInitFatal()) { return; } } AuditLog.Audit(new AuditEvent("Application", "start")); Context.ShowTalkWindowOnStartup = false; Context.AppAgentMgr.EnableContextualMenusForDialogs = false; Context.AppAgentMgr.EnableContextualMenusForMenus = false; Context.AppAgentMgr.DefaultAgentForContextSwitchDisable = Context.AppAgentMgr.NullAgent; if (splash != null) { splash.Close(); } if (!Context.PostInit()) { MessageBox.Show(Context.GetInitCompletionStatus(), R.GetString("InitializationError")); return; } Common.Init(); Context.AppWindowPosition = Windows.WindowPosition.CenterScreen; try { var form = PanelManager.Instance.CreatePanel("TalkApplicationScanner"); if (form != null) { // Add ad-hoc agent that will handle the form IApplicationAgent agent = Context.AppAgentMgr.GetAgentByName("Talk Application Agent"); if (agent == null) { MessageBox.Show("Could not find application agent for this application."); return; } Context.AppAgentMgr.AddAgent(form.Handle, agent); Context.AppPanelManager.ShowDialog(form as IPanel); } else { MessageBox.Show(String.Format(R.GetString("InvalidFormName"), "TalkApplicationScanner"), R.GetString("Error")); return; } AppCommon.ExitMessageShow(); AuditLog.Audit(new AuditEvent("Application", "stop")); Context.Dispose(); Common.Uninit(); AppCommon.ExitMessageClose(); Log.Close(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } AppCommon.OnExit(); }
public static void Main(String[] args) { if (AppCommon.OtherInstancesRunning()) { return; } Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); FileUtils.LogAssemblyInfo(); parseCommandLine(args); AppCommon.LoadGlobalSettings(); AppCommon.SetUserName(_userName); AppCommon.SetProfileName(_profile); if (!AppCommon.CreateUserAndProfile()) { return; } if (!AppCommon.LoadUserPreferences()) { return; } Common.AppPreferences.AppId = "ACATApp"; Common.AppPreferences.AppName = "ACAT App"; CommandDescriptors.Init(); Log.SetupListeners(); if (!AppCommon.SetCulture()) { return; } CommandDescriptors.Init(); if (!String.IsNullOrEmpty(_panelConfig)) { Common.AppPreferences.PreferredPanelConfigNames = _panelConfig; } Splash splash = new Splash(2000); splash.Show(); Context.PreInit(); Common.PreInit(); if (!Context.Init()) { splash.Close(); splash = null; TimedMessageBox.Show(Context.GetInitCompletionStatus()); if (Context.IsInitFatal()) { return; } } if (splash != null) { splash.Close(); } AuditLog.Audit(new AuditEvent("Application", "start")); Context.ShowTalkWindowOnStartup = Common.AppPreferences.ShowTalkWindowOnStartup; Context.AppAgentMgr.EnableContextualMenusForDialogs = Common.AppPreferences.EnableContextualMenusForDialogs; Context.AppAgentMgr.EnableContextualMenusForMenus = Common.AppPreferences.EnableContextualMenusForMenus; if (Context.ShowTalkWindowOnStartup) { Context.AppTalkWindowManager.ToggleTalkWindow(); Context.ShowTalkWindowOnStartup = false; } if (!Context.PostInit()) { MessageBox.Show(Context.GetInitCompletionStatus(), R.GetString("InitializationError")); return; } Common.Init(); try { Application.Run(); AppCommon.ExitMessageShow(); AuditLog.Audit(new AuditEvent("Application", "stop")); Context.Dispose(); Common.Uninit(); AppCommon.ExitMessageClose(); Log.Close(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } AppCommon.OnExit(); }
public static void Main(String[] args) { if (AppCommon.OtherInstancesRunning()) { return; } //Windows.TurnOffDPIAwareness(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); parseCommandLine(args); AppCommon.LoadGlobalSettings(); //Set the active user/profile information AppCommon.SetUserName(); AppCommon.SetProfileName(); if (!AppCommon.CreateUserAndProfile()) { return; } if (!AppCommon.LoadUserPreferences()) { return; } Common.AppPreferences.AppName = "ACAT Tryout"; Log.SetupListeners(); if (!AppCommon.SetCulture()) { return; } Splash splash = new Splash(2000); splash.Show(); splash.Close(); Context.PreInit(); Common.PreInit(); try { if (!Context.Init(Context.StartupFlags.Minimal | Context.StartupFlags.TextToSpeech)) { MessageBox.Show(R.GetString("ContextInitializationError")); return; } } catch (Exception ex) { MessageBox.Show(String.Format("ContextInitializationErrorException", ex)); return; } if (!Context.PostInit()) { MessageBox.Show(Context.GetInitCompletionStatus(), R.GetString("InitializationError")); return; } Common.Init(); var formName = String.IsNullOrEmpty(_formName) ? "ACATTryoutForm" : _formName; var form = PanelManager.Instance.CreatePanel(formName); if (form != null) { Context.AppPanelManager.Show(null, form as IPanel); } else { MessageBox.Show(String.Format(R.GetString("InvalidFormName"), formName), R.GetString("Error")); return; } try { Application.Run(); AppCommon.ExitMessageShow(); Context.Dispose(); Common.Uninit(); AppCommon.ExitMessageClose(); Log.Close(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } AppCommon.OnExit(); }
public static void Main(String[] args) { if (AppCommon.OtherInstancesRunning()) { return; } Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); FileUtils.LogAssemblyInfo(); AppCommon.LoadGlobalSettings(); AppCommon.SetUserName(); AppCommon.SetProfileName(); if (!AppCommon.CreateUserAndProfile()) { return; } if (!AppCommon.LoadUserPreferences()) { return; } Common.AppPreferences.AppId = "ACATPhrase"; Common.AppPreferences.AppName = "ACAT Phrases"; if (!AppCommon.SetCulture()) { return; } Log.SetupListeners(); CommandDescriptors.Init(); setSwitchMapCommands(); if (!createPanelClassConfig()) { return; } Common.AppPreferences.PreferredPanelConfigNames = _panelConfigClassName; Splash splash = new Splash(1000); splash.Show(); Context.PreInit(); Common.PreInit(); Context.AppAgentMgr.EnableAppAgentContextSwitch = false; if (!Context.Init(Context.StartupFlags.Minimal | Context.StartupFlags.TextToSpeech | Context.StartupFlags.AgentManager | Context.StartupFlags.WindowsActivityMonitor | Context.StartupFlags.Abbreviations)) { splash.Close(); splash = null; TimedMessageBox.Show(Context.GetInitCompletionStatus()); if (Context.IsInitFatal()) { return; } } AuditLog.Audit(new AuditEvent("Application", "start")); Context.ShowTalkWindowOnStartup = false; Context.AppAgentMgr.EnableContextualMenusForDialogs = false; Context.AppAgentMgr.EnableContextualMenusForMenus = false; Context.AppAgentMgr.DefaultAgentForContextSwitchDisable = Context.AppAgentMgr.NullAgent; if (splash != null) { splash.Close(); } if (!Context.PostInit()) { MessageBox.Show(Context.GetInitCompletionStatus(), R.GetString("InitializationError")); return; } Common.Init(); Context.AppWindowPosition = Windows.WindowPosition.CenterScreen; try { var phraseSpeakScanner = Context.AppPanelManager.CreatePanel(_phraseSpeakScannerName); if (phraseSpeakScanner != null) { var invoker = (phraseSpeakScanner as IExtension).GetInvoker(); invoker.SetValue("ShowSearchButton", false); Context.AppPanelManager.ShowDialog(phraseSpeakScanner as IPanel); } AppCommon.ExitMessageShow(); AuditLog.Audit(new AuditEvent("Application", "stop")); Context.Dispose(); Common.Uninit(); AppCommon.ExitMessageClose(); Log.Close(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } AppCommon.OnExit(); }