private void OnDetectStartupProjectsComplete()
        {
            // Close the startup window
            bool bVisible = DetectStartupProjectSettingsWindow.Visible;

            DetectStartupProjectSettingsWindow.Close();
            DetectStartupProjectSettingsWindow = null;

            // Create the main window
            MainWindowInstance = new MainWindow(ApiUrl, DataFolder, bRestoreState, UpdateSpawn ?? Assembly.GetExecutingAssembly().Location, DetectStartupProjectSettingsTask.Results, Log, Settings);
            if (bUnstable)
            {
                MainWindowInstance.Text += String.Format(" (UNSTABLE BUILD {0})", Assembly.GetExecutingAssembly().GetName().Version);
            }
            if (bVisible)
            {
                MainWindowInstance.Show();
                if (!bRestoreState)
                {
                    MainWindowInstance.Activate();
                }
            }
            MainWindowInstance.FormClosed += MainWindowInstance_FormClosed;

            // Delete the project settings task
            DetectStartupProjectSettingsTask.Dispose();
            DetectStartupProjectSettingsTask = null;
        }
Exemplo n.º 2
0
        public static ModalTaskResult Execute(IWin32Window Owner, IModalTask Task, string InTitle, string InMessage, out string ErrorMessage)
        {
            ModalTaskWindow Window = new ModalTaskWindow(Task, InTitle, InMessage, (Owner == null)? FormStartPosition.CenterScreen : FormStartPosition.CenterParent);

            Window.Complete += () => Window.Close();
            Window.ShowDialog(Owner);
            ErrorMessage = Window.ErrorMessage;
            return(Window.Result);
        }
        private void OnDetectStartupProjectsComplete()
        {
            // Close the startup window
            bool bVisible = DetectStartupProjectSettingsWindow.Visible;

            DetectStartupProjectSettingsWindow.Close();
            DetectStartupProjectSettingsWindow = null;

            // Copy all the logs to the main log
            foreach (BufferedTextWriter StartupLog in StartupLogs)
            {
                foreach (string Line in StartupLog.Lines)
                {
                    Log.WriteLine("{0}", Line);
                }
            }

            // Clear out the cache folder
            Utility.ClearPrintCache(CacheFolder);

            // Get a list of all the valid projects to open
            DetectProjectSettingsResult[] StartupProjects = DetectStartupProjectSettingsTask.Results.Where(x => x != null).ToArray();

            // Create the main window
            MainWindowInstance = new MainWindow(UpdateMonitor, ApiUrl, DataFolder, CacheFolder, bRestoreState, UpdateSpawn ?? Assembly.GetExecutingAssembly().Location, bUnstable, StartupProjects, DefaultConnection, Log, Settings);
            if (bVisible)
            {
                MainWindowInstance.Show();
                if (!bRestoreState)
                {
                    MainWindowInstance.Activate();
                }
            }
            MainWindowInstance.FormClosed += MainWindowInstance_FormClosed;

            // Delete the project settings task
            DetectStartupProjectSettingsTask.Dispose();
            DetectStartupProjectSettingsTask = null;
        }