Ejemplo n.º 1
0
        static void Main( string[] args ) {
            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 );

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault( false );

            AutomaticModeOptions autoOpts = ParseAutoOptions( args );

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

            } else {
                Program.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();
        }
Ejemplo n.º 2
0
        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() );

            settings.Save();

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