Beispiel #1
0
        public static void Main(string[] args)
        {
            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;

            if (args.Length > 0)
            {
                Logger.Info("Starting app with command line arguments: {0}", string.Join(", ", args));

                AutoFileSaver <SettingsModel> autoFileSaver = new AutoFileSaver <SettingsModel>("settings.xml", true);
                AppearanceHandler             handler       = new AppearanceHandler(autoFileSaver.Model);

                foreach (string arg in args)
                {
                    switch (arg)
                    {
                    case "/light":
                        handler.SwitchToLightTheme();
                        break;

                    case "/dark":
                        handler.SwitchToDarkTheme();
                        break;

                    case "/update":
                        AutoUpdater autoUpdater = new AutoUpdater(true, true);
                        autoUpdater.CheckForUpdates(true).Wait();
                        break;

                    case "/clean":
                        TaskSchedulerHandler.DeleteAllTasks();
                        break;

                    default:
                        Logger.Error("Command line argument is not accepted: {0}", arg);
                        break;
                    }
                }
            }
            else
            {
                App app = new App();
                app.InitializeComponent();
                app.Run();
            }
        }