Ejemplo n.º 1
0
        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());
        }
Ejemplo n.º 2
0
        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();
        }
Ejemplo n.º 3
0
        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();
        }
Ejemplo n.º 4
0
 public static void Setup()
 {
     if (!Directory.Exists(AppEnvironment.DataPath))
     {
         Directory.CreateDirectory(AppEnvironment.DataPath);
     }
     if (!Debugger.IsAttached)
     {
         ExceptionHandler.AddGlobalHandlers();
     }
     Config.Load();
     LanguageManager.Load();
 }
Ejemplo n.º 5
0
        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();
        }
Ejemplo n.º 6
0
        private void AppStartup(object sender, StartupEventArgs args)
        {
            if (!Debugger.IsAttached)
            {
                ExceptionHandler.AddGlobalHandlers();
            }

            var mainWindow = new MainWindow
            {
                DataContext = new MainWindowViewModel()
            };

            mainWindow.Show();
            Tools.CheckForUpdates();
        }
Ejemplo n.º 7
0
 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();
     }
 }
Ejemplo n.º 8
0
        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());
        }
Ejemplo n.º 9
0
 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);
     }
 }
Ejemplo n.º 10
0
        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();
        }
Ejemplo n.º 11
0
        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);
            }
        }
Ejemplo n.º 12
0
        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();
        }
Ejemplo n.º 13
0
        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());
        }