PurplePen.Program.Main C# (CSharp) Method

Main() private method

private Main ( string args ) : void
args string
return void
        static void Main(string[] args)
        {
            // Enable crash reporting.
            Application.ThreadException += (sender, e) => SendCrashReport(e.Exception);
            AppDomain.CurrentDomain.UnhandledException += (sender, e) => {
                    SendCrashReport((Exception)e.ExceptionObject);
                    Environment.Exit(0);
                };

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

            InitUILanguage();
            InitClientId();

            if (args.Length > 0 && LoadCommandLineFile(args[0])) {
                // We successfully loaded a file from the command line.
                // Nothing more to do here.
            }
            else {
                // No command line args. Show initial screen to load/create an event.
                new InitialScreen().Show();
            }

            Application.Run();
        }