Inheritance: System.Windows.Forms.Form, IAutoWikiBrowser
        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);

                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.Handle(ex);
            }
        }
        static void Main(string[] args)
        {
            try
            {		
                System.Threading.Thread.CurrentThread.Name = "Main thread";
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.ThreadException += ApplicationThreadException;

                if (Variables.UsingMono)
                {
                    MessageBox.Show("AWB is not currently supported by mono", "Not supported",
                        MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }

                AwbDirs.MigrateDefaultSettings();

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

                Application.Run(awb);
            }
            catch (Exception ex)
            {
                ErrorHandler.Handle(ex);
            }
        }
        static void Main(string[] args)
        {
            try
            {
                System.Threading.Thread.CurrentThread.Name = "Main thread";
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);

                string fileToLoad = "";
                int profileID = -1;

                for (int i = 0; i < args.Length; i++)
                {
                    switch (args[i])
                    {
                        case "/s":
                            try
                            {
                                string tmp = args[i + 1].ToString();
                                if (tmp.Contains(".xml") && System.IO.File.Exists(tmp))
                                    fileToLoad = tmp;
                            }
                            catch { }
                            break;
                        case "/u":
                            try { profileID = Convert.ToInt32(args[i + 1]); }
                            catch { }
                            break;
                    }
                }

                MainForm awb = new MainForm();

                awb.ProfileToLoad = profileID;
                awb.SettingsFile = fileToLoad;

                Program.AWB = awb;
                Application.Run(awb);
            }
            catch (Exception ex)
            {
                WikiFunctions.ErrorHandler.Handle(ex);
            }
        }
        static void Main(string[] args)
        {
            try
            {		
                System.Threading.Thread.CurrentThread.Name = "Main thread";
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.ThreadException += Application_ThreadException;

                if (WikiFunctions.Variables.DetectMono())
                    throw new NotSupportedException("AWB is not currently supported by mono");

                MainForm awb = new MainForm();

                for (int i = 0; i < args.Length; i++)
                {
                    switch (args[i])
                    {
                        case "/s":
                            if ((i + 1) < args.Length)
                            {
                                string tmp = args[i + 1];
                                if (tmp.Contains(".xml") && System.IO.File.Exists(tmp))
                                    awb.SettingsFile = tmp;
                                else if (!tmp.Contains(".xml") && System.IO.File.Exists(tmp + ".xml"))
                                    awb.SettingsFile = tmp + ".xml";
                            }
                            break;
                        case "/u":
                            if ((i + 1) < args.Length)
                                awb.ProfileToLoad = int.Parse(args[i + 1]);
                            break;
                    }
                }

                AWB = awb;
                Application.Run(awb);
            }
            catch (Exception ex)
            {
                WikiFunctions.ErrorHandler.Handle(ex);
            }
        }
        static void Main(string[] args)
        {
            try
            {
                System.Threading.Thread.CurrentThread.Name = "Main thread";
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException);

                MainForm awb = new MainForm();

                for (int i = 0; i < args.Length; i++)
                {
                    switch (args[i])
                    {
                        case "/s":
                            try
                            {
                                string tmp = args[i + 1].ToString();
                                if (tmp.Contains(".xml") && System.IO.File.Exists(tmp))
                                    awb.SettingsFile = tmp;
                            }
                            catch { }
                            break;
                        case "/u":
                            try { awb.ProfileToLoad = int.Parse(args[i + 1]); }
                            catch { }
                            break;
                    }
                }

                Program.AWB = awb;
                Application.Run(awb);
            }
            catch (Exception ex)
            {
                WikiFunctions.ErrorHandler.Handle(ex);
            }
        }
Exemple #6
0
 internal JsAdapter(MainForm owner)
 {
     _owner = owner;
 }