static void Main() { if (!Debugger.IsAttached) { ExceptionHandler.AddGlobalHandlers(); } Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); if (AppEnvironment.SettingValue("CheckForUpdates", true)) { Tools.CheckForUpdates(); } // create the application data path, if necessary try { if (!Directory.Exists(AppEnvironment.DataPath)) { Directory.CreateDirectory(AppEnvironment.DataPath); } } catch { } Application.Run(new Forms.MainWindow()); }
public void Start(bool serviceMode = false) { isService = serviceMode; if (Process.GetProcessesByName( Path.GetFileNameWithoutExtension(Assembly.GetEntryAssembly().Location)) .Length > 1) { Process.GetCurrentProcess().Kill(); } if (!Directory.Exists(AppEnvironment.DataPath)) { Directory.CreateDirectory(AppEnvironment.DataPath); } if (!Debugger.IsAttached) { ExceptionHandler.AddGlobalHandlers(); Console.WriteLine("Exception Handlers Attached"); } //Fix screensize issues for Screen Share if (Tools.RunningPlatform() == Tools.Platform.Windows && Environment.OSVersion.Version.Major >= 6) { SetProcessDPIAware(); } Setup(); }
private void AppStartup(object sender, StartupEventArgs args) { if (!Debugger.IsAttached) { ExceptionHandler.AddGlobalHandlers(); } var container = new UnityContainer(); container.RegisterType <Raids>(); container.RegisterInstance <IGlobalVariables>(new GlobalVariables()); container.RegisterType <IControllerFactory, ControllerFactory>(); container.RegisterInstance <ISettingsController>(new SettingsController()); container.RegisterInstance <ITwitterAuthenticator>( new TwitterAuthenticator(container.Resolve <ISettingsController>())); container.RegisterInstance <IBlacklistController>(new BlacklistController()); container.RegisterInstance <IRaidsController>( new RaidsController(container.Resolve <IBlacklistController>())); container.RegisterInstance <IRaidlistController>(new RaidListController()); container.RegisterInstance <ITweetProcessor>(new TweetProcessor()); container.RegisterType <ITweetObserver, TweetObserver>(); container.RegisterType <SettingsViewModel>(); container.RegisterType <MainViewModel>(); container.RegisterType <MainWindow>(); container.Resolve <MainWindow>().Show(); }
public static void Setup() { if (!Directory.Exists(AppEnvironment.DataPath)) { Directory.CreateDirectory(AppEnvironment.DataPath); } if (!Debugger.IsAttached) { ExceptionHandler.AddGlobalHandlers(); } Config.Load(); LanguageManager.Load(); }
private static void Main(string[] args) { //fixes wrong screensize for screen share if (Environment.OSVersion.Version.Major >= 6) { SetProcessDPIAware(); } if (!Directory.Exists(AppEnvironment.DataPath)) { Directory.CreateDirectory(AppEnvironment.DataPath); } if (!Debugger.IsAttached) { ExceptionHandler.AddGlobalHandlers(); } Console.WriteLine("Exception Handlers attached"); Settings.Initialize("Config.json"); Console.Title = Resources.Program_Title; Tools.ConfigureServer(); var useTerminal = Convert.ToBoolean(Settings.Get("Terminal").AllowTerminal); var usePlugins = Convert.ToBoolean(Settings.Get("Plugins").LoadPlugins); var useWebServer = Convert.ToBoolean(Settings.Get("WebServer").UseWebServer); WebCamManager.LoadWebcams(); if (usePlugins) { PluginHandler.LoadPlugins(); } if (useWebServer) { HttpServer.Setup(); } var systemUtilities = new SystemUtilities(); systemUtilities.Start(); //Keep down here if you actually want a functional program TaskManagerServer.Start(); if (useTerminal) { TerminalManagerServer.Start(); } Console.ReadLine(); }
private void AppStartup(object sender, StartupEventArgs args) { if (!Debugger.IsAttached) { ExceptionHandler.AddGlobalHandlers(); } var mainWindow = new MainWindow { DataContext = new MainWindowViewModel() }; mainWindow.Show(); Tools.CheckForUpdates(); }
public static void Setup() { if (!Directory.Exists(AppEnvironment.DataPath)) { Directory.CreateDirectory(AppEnvironment.DataPath); } if (!Debugger.IsAttached) { ExceptionHandler.AddGlobalHandlers(); } Config.Load(); if (!Config.Instance.AppSettings.DisableSteamIntegration) { SteamApi.Init(); } }
static void Main() { if (!Debugger.IsAttached) { ExceptionHandler.AddGlobalHandlers(); } Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); if (!AppEnvironment.SettingValue("DisableSteamIntegration", false)) { try { if (!Steamworks.SteamAPI.Init()) { MessageBox.Show("Steam API failed to initialize!", "Error Loading Steam", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else if (!Steamworks.Packsize.Test()) { MessageBox.Show("Steam failed to PackTest!", "Error Loading Steam", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { Steam_Loaded = true; } } catch (Exception ex) { MessageBox.Show(ex.GetType().ToString() + "\r\n" + ex.Message, "Error Loading Steam", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } // create the application data path, if necessary try { if (!Directory.Exists(AppEnvironment.DataPath)) { Directory.CreateDirectory(AppEnvironment.DataPath); } } catch { } Application.Run(new Forms.MainWindow()); }
private static void Main(string[] args) { Console.Title = Resources.Program_Title; if (!Debugger.IsAttached) ExceptionHandler.AddGlobalHandlers(); if (args.Length > 0) { // Command line given, display gui Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Launcher()); } else { AllocConsole(); ConsoleMain(args); } }
private async void AppStartup(object sender, StartupEventArgs args) { if (!Debugger.IsAttached) { ExceptionHandler.AddGlobalHandlers(); } HistoryController.Load(); SettingsController.Load(); FavoritesController.Load(); await Task.Delay(200); var mainWindow = new MainWindow { DataContext = new MainWindowViewModel() }; mainWindow.Show(); }
private static void Main(string[] args) { //Fix screensize issues for Screen Share if (Environment.OSVersion.Version.Major >= 6) { SetProcessDPIAware(); } HideWindow(); try { if (Process.GetProcessesByName(Path.GetFileNameWithoutExtension(Assembly.GetEntryAssembly().Location)) .Count() > 1) { return; } if (!Directory.Exists(AppEnvironment.DataPath)) { Directory.CreateDirectory(AppEnvironment.DataPath); } if (!Debugger.IsAttached) { ExceptionHandler.AddGlobalHandlers(); Console.WriteLine("Exception Handlers Attached"); } ProfileOptimization.SetProfileRoot(AppEnvironment.DataPath); ProfileOptimization.StartProfile("Startup.Profile"); var ulterius = new Ulterius(); ulterius.Start(); Console.ReadKey(); } catch (Exception ex) { Console.WriteLine("Something unexpected occured"); Console.WriteLine(ex.Message); Console.WriteLine(ex.StackTrace); } }
public void Start(bool serviceMode = false) { isService = serviceMode; if (Process.GetProcessesByName( Path.GetFileNameWithoutExtension(Assembly.GetEntryAssembly().Location)) .Length > 1) { Process.GetCurrentProcess().Kill(); } if (!Directory.Exists(AppEnvironment.DataPath)) { Directory.CreateDirectory(AppEnvironment.DataPath); } if (!Debugger.IsAttached) { ExceptionHandler.AddGlobalHandlers(); Console.WriteLine("Exception Handlers Attached"); } Setup(); }
static void Main() { if (!Debugger.IsAttached) { ExceptionHandler.AddGlobalHandlers(); } Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); if (!AppEnvironment.SettingValue("DisableSteamIntegration", false)) { try { SteamLoaded = SteamApi.Init(); } catch (Exception ex) { Console.WriteLine(ex.GetType().ToString() + "\r\n" + ex.Message, "A fatal Steam error was detected"); } } // create the application data path, if necessary try { if (!Directory.Exists(AppEnvironment.DataPath)) { Directory.CreateDirectory(AppEnvironment.DataPath); } } catch { // ignored } Application.Run(new Forms.MainWindow()); }