public static void Main(string[] args)
        {
            AppBase manager = new AppBase();

            manager.Run(args);
        }
Exemple #2
0
        static void Main(string[] args)
        {
            AppBase appBase = new AppBase();

            appBase.Run(args);
        }
Exemple #3
0
        private static void Main(string[] args)
        {
            try
            {
                if (Settings.Default.FirstRun)
                {
                    Settings.Default.Upgrade();
                    Settings.Default.FirstRun = false;
                    Settings.Default.Save();
                }
            }
            catch (ConfigurationErrorsException ex)
            {
                DockingService.ShowError("Error upgrading settings", ex);
            }

            Application.EnableVisualStyles();

            DockPanel          panel              = new WabbitcodeDockPanel();
            StatusStrip        statusBar          = new WabbitcodeStatusBar();
            ToolStripContainer toolStripContainer = new WabbitcodeToolStripContainer(statusBar, panel);

            Task.Factory.StartNew(() => InitializeDependencies(panel, statusBar, toolStripContainer), TaskCreationOptions.PreferFairness);
            Task.Factory.StartNew(() =>
            {
                FileLocations.InitDirs();
                FileLocations.InitFiles();
                HighlightingUtils.MakeHighlightingFile();
            });

            Task.Factory.StartNew(() =>
            {
                if (!UpdateService.CheckForUpdate())
                {
                    return;
                }

                var result = MessageBox.Show("New version available. Download now?", "Update Available", MessageBoxButtons.YesNo, MessageBoxIcon.None);
                if (result != DialogResult.Yes)
                {
                    return;
                }

                UpdateService.StartUpdater();
                Application.Exit();
            });

            int     numErrors = 0;
            AppBase appBase   = new AppBase(toolStripContainer);

#if !DEBUG
            try
            {
#endif
            appBase.Run(args);
#if !DEBUG
        }
        catch (Exception ex)
        {
            numErrors++;
            DockingService.ShowError("Unhandled exception occurred. Please report this to the developers", ex);
        }
#endif

            if (numErrors == 0)
            {
                return;
            }

            do
            {
                try
                {
                    appBase.DoEvents();
                }
                catch (Exception ex)
                {
                    numErrors++;
                    DockingService.ShowError("Unhandled exception occurred. Please report this to the developers", ex);
                }
            } while (numErrors < 5);
        }