Beispiel #1
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            if ((!FFN_Switcher.Properties.Settings.Default.SetupWizardDone) || (!FFN_Switcher.Properties.Settings.Default.LicenseAccepted))
            {
                #region Setup Wizard
                SetupWizard_Step1 Step1 = new SetupWizard_Step1();

                Step1.ShowDialog();

                if (FFN_Switcher.Properties.Settings.Default.LicenseAccepted)
                {
                    FFN_Switcher.Properties.Settings.Default.Save();

                    SetupWizard_Step2 Step2 = new SetupWizard_Step2();

                    Step2.ShowDialog();

                    if (FFN_Switcher.Properties.Settings.Default.Wizard_Step2_Done)
                    {
                        SetupWizard_Step3 Step3 = new SetupWizard_Step3();

                        Step3.ShowDialog();

                        if (FFN_Switcher.Properties.Settings.Default.Wizard_Step3_Done)
                        {
                            SetupWizard_Step4 Step4 = new SetupWizard_Step4();
                            Step4.ShowDialog();

                            if (FFN_Switcher.Properties.Settings.Default.Wizard_Step4_Done)
                            {
                                SetupWizard_Step5 Step5 = new SetupWizard_Step5();
                                Step5.ShowDialog();

                                if (FFN_Switcher.Properties.Settings.Default.Wizard_Step5_Done)
                                {
                                    SetupWizard_Step6 Step6 = new SetupWizard_Step6();
                                    Step6.ShowDialog();

                                    if (FFN_Switcher.Properties.Settings.Default.Wizard_Step6_Done)
                                    {
                                        SetupWizard_Step7 Step7 = new SetupWizard_Step7();
                                        Step7.ShowDialog();

                                        if (FFN_Switcher.Properties.Settings.Default.Wizard_Step7_Done)
                                        {
                                            SetupWizard_Step8 Step8 = new SetupWizard_Step8();
                                            Step8.ShowDialog();

                                            if (FFN_Switcher.Properties.Settings.Default.Wizard_Step8_Done)
                                            {
                                                SetupWizard_Step9 Step9 = new SetupWizard_Step9();
                                                Step9.ShowDialog();

                                                if (FFN_Switcher.Properties.Settings.Default.Wizard_Step9_Done)
                                                {
                                                    SetupWizard_Step10 Step10 = new SetupWizard_Step10();
                                                    Step10.ShowDialog();

                                                    if (FFN_Switcher.Properties.Settings.Default.Wizard_Step10_Done)
                                                    {
                                                        FFN_Switcher.Properties.Settings.Default.SetupWizardDone = true;
                                                        FFN_Switcher.Properties.Settings.Default.Save();
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
                #endregion
            }

            if (FFN_Switcher.Properties.Settings.Default.LicenseAccepted)
            {
                MainWindow mainWindow = new MainWindow();

                #region Data
                Switcher Switcher = new Switcher();
                mainWindow.internalSwitcher = Switcher;
                #endregion

                #region ConsoleOutputLogger
                ConsoleOutputLogger._Window = mainWindow;
                ConsoleOutputLogger.verbose = true;
                ConsoleOutputLogger.writeLogfile = false;
                #endregion

                #region Logo
                ConsoleOutputLogger.WriteLine("[SWITCHER] Freies Funknetz Switcher Tool");
                ConsoleOutputLogger.WriteLine("[SWITCHER] Version "+Version.VersionString);
                ConsoleOutputLogger.WriteLine("[SWITCHER] "+Version.LicenseString);
                ConsoleOutputLogger.WriteLine("[SWITCHER] "+Version.CopyrightString);
                #endregion

                #region load settings
                ConsoleOutputLogger.verbose = FFN_Switcher.Properties.Settings.Default.LogToScreenEnabled;
                if (!FFN_Switcher.Properties.Settings.Default.LogToFileEnabled)
                {
                    ConsoleOutputLogger.writeLogfile = false;
                }
                else
                {
                    ConsoleOutputLogger.Logfilename = FFN_Switcher.Properties.Settings.Default.Logfile;
                    ConsoleOutputLogger.writeLogfile = true;
                }
                //}
                #endregion

                #region start Switcher...
                Thread SwitcherThread = new Thread(new ThreadStart(Switcher.Run));
                SwitcherThread.Start();
                #endregion

                Application.Run(mainWindow);

                #region Shutdown
                Switcher.Shutdown();
                Switcher.done = true;
                Shutdown();
                #endregion
            }
            else
            {
                MessageBox.Show("Akzeptieren Sie die Lizenz dieser Software um sie zu verwenden.");
            }
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            #region Data
            Switcher Switcher = new Switcher();
            #endregion

            #region ConsoleOutputLogger
            ConsoleOutputLogger.verbose = true;
            ConsoleOutputLogger.writeLogfile = false;
            #endregion

            #region Logo
            ConsoleOutputLogger.WriteLine("[SWITCHER] Freies Funknetz Switcher Tool");
            ConsoleOutputLogger.WriteLine("[SWITCHER] Version " + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString());
            ConsoleOutputLogger.WriteLine("[SWITCHER] Licensed under Attribution-NonCommercial-ShareAlike 3.0 Unported license");
            ConsoleOutputLogger.WriteLine("[SWITCHER] (C) 2008 Daniel Kirstenpfad - http://www.schrankmonster.de");
            #endregion

            #region Configfile
            string ConfigFile = "ffn_switcher.config";

            if (args.Length > 0)
            {
                if (args[0] == "-?")
                {
                    ConsoleOutputLogger.WriteLine("Verwendung mit Parametern:");
                    ConsoleOutputLogger.WriteLine("");
                    ConsoleOutputLogger.WriteLine("ffn-switcher.exe -?                          -   diese Hilfe");
                    ConsoleOutputLogger.WriteLine("ffn-switcher.exe <Konfigurations-Dateiname>  -   eine Konfigurationdatei");
                    ConsoleOutputLogger.WriteLine("                                                 (wird erstellt wenn sie noch nicht existiert)");
                    return;
                }
                else
                {
                    ConfigFile = args[0];
                }
            }
            ConsoleOutputLogger.WriteLine("[SWITCHER] Verwende Konfigurationsdatei: " + ConfigFile);
            #endregion

            #region load settings
            SettingsProcessor Settings_Processor = new SettingsProcessor(ConfigFile, Switcher);
            if (!Settings_Processor.LoadSettings())
            {
                ConsoleOutputLogger.WriteLine("[SWITCHER] Erstelle neue Konfiguration und versuche diese zu laden...");
                Settings_Processor.SaveSettings();
                if (!Settings_Processor.LoadSettings())
                {
                    ConsoleOutputLogger.WriteLine("[SWITCHER] Konnte keine neue Konfiguration erstellen - gebe auf.");
                    Shutdown();
                    return;
                }
            }
            else
            {
                ConsoleOutputLogger.verbose = Switcher.AppSettings.Logging.LoggingToScreenEnabled;
                if (!Switcher.AppSettings.Logging.LoggingToFileEnabled)
                {
                    ConsoleOutputLogger.writeLogfile = false;
                }
                else
                {
                    ConsoleOutputLogger.Logfilename = Switcher.AppSettings.Logging.Logfile;
                    ConsoleOutputLogger.writeLogfile = true;
                }
            }
            #endregion

            #region save settings just to updated them
            Settings_Processor.SaveSettings();
            #endregion

            #region start Switcher...
            Switcher.Run();
            #endregion

            #region Shutdown
            Shutdown();
            #endregion
        }