AutoWikiBrowser.Program.Main C# (CSharp) Method

Main() private method

private Main ( string args ) : void
args string
return void
        static void Main(string[] args)
        {
            try
            {
                System.Threading.Thread.CurrentThread.Name = "Main thread";
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.ThreadException += ApplicationThreadException;

                if (Globals.UsingMono)
                {
                    MessageBox.Show("AWB is not currently supported by mono. You may use it for testing purposes, but functionality is not guaranteed.",
                        "Not supported",
                        MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }

                AwbDirs.MigrateDefaultSettings();

                MainForm awb = new MainForm();
                AWB = awb;
                awb.ParseCommandLine(args);

                Article.SetAddListener(MyTrace.AddListener, MyTrace, "AWB");

                Application.Run(awb);
            }
            catch (Exception ex)
            {
                if (ex is SecurityException) //"Fix" - http://geekswithblogs.net/TimH/archive/2006/03/08/71714.aspx
                    MessageBox.Show("AWB is unable to start up from the current location due to a lack of permissions.\r\nPlease try on a local drive or similar.", "Permissions Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                else
                    ErrorHandler.HandleException(ex);
            }
        }