static void Main()
        {
            FatalError.InitializeHandler();

            Logger            = new AppLogger();
            Logger.Level      = LoggerLevel.None;
            Logger.DateFormat = "HH:mm:ss'.'ffffff";

            Logger.MaxFileSize      = 2000000;
            Logger.MaxBackup        = 1;
            Logger.FileNameTemplate = "Depressurizer.log";

            Settings settings = Settings.Instance();

            settings.Load();

            Logger.Write(LoggerLevel.Info, GlobalStrings.Program_ProgramInitialized, Logger.Level);

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new FormMain());

            Logger.Write(LoggerLevel.Info, GlobalStrings.Program_ProgramClosing);
            Logger.EndSession();
        }
Example #2
0
        private static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            FatalError.InitializeHandler();

            Logger            = new AppLogger();
            Logger.Level      = LoggerLevel.None;
            Logger.DateFormat = "HH:mm:ss'.'ffffff";

            Logger.MaxFileSize      = 2000000;
            Logger.MaxBackup        = 1;
            Logger.FileNameTemplate = "Depressurizer.log";

            Settings.Instance.Load();

            Logger.Write(LoggerLevel.Info, GlobalStrings.Program_ProgramInitialized, Logger.Level);

            AutomaticModeOptions autoOpts = ParseAutoOptions(args);

            if (autoOpts != null)
            {
                Logger.Write(LoggerLevel.Info, "Automatic mode set, loading automatic mode form.");
                Logger.WriteObject(LoggerLevel.Verbose, autoOpts, "Automatic Mode Options:");
                Application.Run(new AutomaticModeForm(autoOpts));
            }
            else
            {
                Logger.Write(LoggerLevel.Info, "Automatic mode not set, loading main form.");
                Application.Run(new FormMain());
            }

            Settings.Instance.Save();

            Logger.Write(LoggerLevel.Info, GlobalStrings.Program_ProgramClosing);
            Logger.EndSession();
        }