コード例 #1
0
ファイル: Program.cs プロジェクト: Spegeli/DealReminder
        static void Main(string[] args)
        {
            AppDomain.CurrentDomain.SetData("DataDirectory", Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Data"));
            Settings.ChangeAppConfig(Settings.SettingsFile);

            // For the sake of this example, we're just printing the arguments to the console.

            /*
             * for (int i = 0; i < args.Length; i++)
             * {
             *  MessageBox.Show("args["+ i + "] == " + args[i]);
             * }
             */

            Logger.SetLogger();

            if (Updater.UpdateAvailable())
            {
                Logger.Write("Loading Updater GUI...");
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(new Updater());
                return;
            }

            FoldersFilesAndPaths.StartUpCheck();
            Settings.StartUpCheck();
            Database.StartUpCheck();

            if (!String.IsNullOrWhiteSpace(Settings.Get <string>("PremiumEmail")) &&
                !String.IsNullOrWhiteSpace(Settings.Get <string>("PremiumKey")))
            {
                Premium.CheckAutomatic();
            }

            if (!Settings.IsPremium && Process
                .GetProcessesByName(
                    Path.GetFileNameWithoutExtension(System.Reflection.Assembly.GetEntryAssembly().Location))
                .Length > 1)
            {
                Logger.Write(
                    "DealReminder läuft bereits....Multi Instanzen nur mit Premium möglich...");
                MessageBox.Show(@"DealReminder läuft bereits!" + Environment.NewLine +
                                @"Nur mit Premium sind keine mehrfach Instanzen von DealReminder erlaubt!" +
                                Environment.NewLine +
                                @"Diese DealReminder Instanz wird beendet!",
                                @"DealReminder für Amazon", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Application.Exit();
            }

            //Browser Link zum Premium Kaufen
            //if (!Settings.IsPremium)
            //WebUtils.OpenBrowser("http://amzn.to/2rPwKP1");

            Logger.Write("Loading Main GUI...");
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Main());
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: Spegeli/DealReminder
        static void Main(string[] args)
        {
            AppDomain.CurrentDomain.SetData("DataDirectory", Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Data"));

            // For the sake of this example, we're just printing the arguments to the console.

            /*
             * for (int i = 0; i < args.Length; i++)
             * {
             *  MessageBox.Show("args["+ i + "] == " + args[i]);
             * }
             */

            Logger.SetLogger();

            if (Updater.UpdateAvailable())
            {
                Logger.Write("Loading Updater GUI...");
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(new Updater());
                return;
            }

            FoldersFilesAndPaths.StartUpCheck();
            Settings.StartUpCheck();
            Database.StartUpCheck();

            if (Settings.Get <bool>("AutoLogin") && Login.AutoLoginSuccess())
            {
                Logger.Write("Loading Main GUI...");
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(new Main());
            }
            else
            {
                Logger.Write("Loading Login GUI...");
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(new Login());
            }
        }