System.Windows.Forms.Application.Restart()

Here are the examples of the csharp api class System.Windows.Forms.Application.Restart() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

75 Examples 7

1. Example

Project: HaSuite
Source File: ExceptionHandler.cs
private void Restart(object sender, EventArgs e)
        {
            Application.Restart();
        }

2. Example

Project: HaSuite
Source File: ExceptionHandler.cs
private void Backup(object sender, EventArgs e)
        {
            Application.Restart();
        }

3. Example

Project: ColorWanted
Source File: MainForm.cs
private void trayMenuRestart_Click(object sender, EventArgs e)
        {
            Application.Restart();
        }

4. Example

Project: StarryEyes
Source File: Application.cs
public static void Restart()
        {
            WinForms.Application.Restart();
        }

5. Example

Project: CodeContracts
Source File: Form1.cs
private void editNumberOfPlayersToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Application.Restart();
        }

6. Example

Project: CodeContracts
Source File: Form1.cs
private void newGameToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Application.Restart();
        }

7. Example

Project: IronAHK
Source File: Flow.cs
public static void Reload()
        {
            Application.Restart();
        }

8. Example

Project: SimplyU
Source File: Form1.cs
private void button1_Click(object sender, EventArgs e)
        {
            Application.Restart();
        }

9. Example

Project: SimplyU
Source File: dev_notes.cs
private void btn_agree_Click(object sender, EventArgs e)
        {
            Properties.Settings.Default.terms_agreed = "1";
            Properties.Settings.Default.Save();
            Application.Restart();
        }

10. Example

Project: SimplyU
Source File: dev_properties.cs
private void lbl_flbck_Click(object sender, EventArgs e)
        {
            if (Properties.Settings.Default.dev_fallbck == "1")
            {
                Properties.Settings.Default.dev_fallbck = "0";
                Properties.Settings.Default.dev_theme = "Default";
                Properties.Settings.Default.Save();
                Application.Restart();
            }
            else
            {
                Properties.Settings.Default.dev_theme = "Fallbck";
                Properties.Settings.Default.dev_fallbck = "1";
                Properties.Settings.Default.Save();
                Application.Restart();
            }
        }

11. Example

Project: 3DNUS
Source File: Form1.cs
private void pictureBox5_Click(object sender, EventArgs e)
        {
            Application.Restart();
        }

12. Example

Project: SAMPLauncherNET
Source File: MainForm.cs
private void languagesComboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            int i = languagesComboBox.SelectedIndex;
            if (i >= 0)
            {
                List<Language> langs = new List<Language>(Translator.TranslatorInterface.Languages);
                if (Translator.ChangeLanguage(langs[i]))
                {
                    Application.Restart();
                }
            }
        }

13. Example

Project: chummer5a
Source File: Mainform.cs
private void deleteDatabaserequiresRestartToolStripMenuItem_Click(object sender, EventArgs e)
		{
			PersistentState.Database.Delete();
			Application.Restart();
		}

14. Example

Project: DropboxBusinessAdminTool
Source File: SettingsPresenter.cs
private void OnCommandApplySettings(object sender, System.EventArgs e) {
            ISettingsModel model = base._model as ISettingsModel;
            ISettingsView view = base._view as ISettingsView;
            IMainPresenter presenter = SimpleResolver.Instance.Get<IMainPresenter>();
            PresenterBase.SetModelPropertiesFromView<ISettingsModel, ISettingsView>(
                ref model, view
            );
            UpdateConfigSettings();

            // we will probably don't need to broadcast changes,
            // as previous result becomes no longere meaningful upon update of token or API urls.
            if (SyncContext != null) {
                SyncContext.Post(delegate {
                    view.HideView();
                    presenter.UpdateProgressInfo("Settings Updated");
                    Application.Restart();
                }, null);
            }
        }

15. Example

Project: EvilFOCA
Source File: FormInterfaces.cs
private void SaveSettingsInterface()
        {
            for (int i = 0; i < dgvInterfaces.Rows.Count; i++)
            {
                if (dgvInterfaces.Rows[i].Selected == true && i != Program.CurrentProject.data.settings.Interface)
                {
                    if (IsSplashSetting)
                    {
                        Program.CurrentProject.data.settings.Interface = i;
                        Program.CurrentProject.data.settings.Save();
                    }
                    else
                    {
                        if (MessageBox.Show("To apply new interface setting is necessary to restart application. Do you want to restart Evil Foca?", "Restart needed", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
                        {
                            Program.CurrentProject.data.settings.Interface = i;
                            Program.CurrentProject.data.settings.Save();
                            Application.Restart();
                        }
                    }
                    return;
                }
            }
        }

16. Example

Project: tesvsnip
Source File: MainView.cs
private void uTF8ModeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Framework.Properties.Settings.Default.UseUTF8 = uTF8ModeToolStripMenuItem.Checked;
            if (MessageBox.Show(Resources.RestartText, Resources.InfoText, MessageBoxButtons.YesNoCancel) ==
                DialogResult.Yes)
            {
                Application.Restart();
            }
        }

17. Example

Project: falloutsnip
Source File: MainView.cs
private void uTF8ModeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Framework.Properties.Settings.Default.UseUTF8 = uTF8ModeToolStripMenuItem.Checked;
            if (MessageBox.Show(Resources.RestartText, Resources.InfoText, MessageBoxButtons.YesNoCancel) ==
                DialogResult.Yes)
            {
                Application.Restart();
            }
        }

18. Example

Project: ColorWanted
Source File: BugReportForm.cs
private void btnCancel_Click(object sender, EventArgs e)
        {
            if (cbRestart.Checked)
            {
                Application.Restart();
                return;
            }
            Application.Exit();
        }

19. Example

Project: upScreen
Source File: frmSettings.cs
private void bRemoveAccount_Click(object sender, EventArgs e)
        {
            // If there's only one account in the list, delete it and restart upScreen
            if (cAccounts.Items.Count == 1)
            {
                Settings.Clear();
                Application.Restart();
                Common.KillProcess();
            }
            // otherwise, just remove the selected account and save
            int i = cAccounts.SelectedIndex;            
            Settings.Profiles.RemoveAt(i);
            cAccounts.Items.RemoveAt(i);
            Settings.Save();
            cAccounts.SelectedIndex = 0;

            // Refresh image file format/length fields
            RefreshSettings();
        }

20. Example

Project: LaserGRBL
Source File: MainForm.cs
private void SetLanguage(System.Globalization.CultureInfo ci)
		{
			if (ci != null)
				Settings.SetObject("User Language", ci);
			else
				Settings.DeleteObject("User Language");

			Settings.Save();

			if (System.Windows.Forms.MessageBox.Show(Strings.LanguageRequireRestartNow, Strings.LanguageRequireRestart, MessageBoxButtons.OKCancel) == System.Windows.Forms.DialogResult.OK)
				Application.Restart();
		}

21. Example

Project: Sardauscan
Source File: Program.cs
public static void OnFatalError(Exception e)
		{
			OkCancelDialog dlg = new OkCancelDialog();
			dlg.Text = "Fatal Error, Restart ?";
			CrashReport view = new CrashReport();
			view.SetException(e);
			if (dlg.ShowDialog(view, null) == System.Windows.Forms.DialogResult.OK)
          Application.Restart();
      else
          System.Environment.Exit(0);
		}

22. Example

Project: ScreenRecorder
Source File: AppSettings.cs
private void save_Click(object sender, EventArgs e)
        {
            Settings.Default.FramesPerSec = (int) numericUpDown1.Value;
            Settings.Default.BitmapTempLoc = saveLocBox.Text;
            Settings.Default.Language = langComboBox.SelectedItem as string;
            Settings.Default.VideoLoc = voutLocBox.Text;
            Settings.Default.VideoType = videoTypeBox.SelectedItem as string;

            //save all the user settings.
            Settings.Default.Save();

            //MessageBox.Show("Application must be restarted inorder to apply the changes", "Restart", 
            //    MessageBoxButtons.OKCancel, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, 
            //    MessageBoxOptions.ServiceNotification);
            if (MessageBox.Show("Application must be restarted inorder to apply the changes", "Restart", "Cancel") ==
                YesNo.Yes)
            {
                Application.Restart();
            }
            //Settings.Default.Opacity = (decimal)OpacityBar.Value/10;
        }

23. Example

Project: ScreenRecorder
Source File: Settings.cs
private void save_Click(object sender, EventArgs e)
        {
            Settings.Default.FramesPerSec = (int)numericUpDown1.Value;
            Settings.Default.BitmapTempLoc = saveLocBox.Text;
            Settings.Default.Language = langComboBox.SelectedItem as string;
            Settings.Default.VideoLoc = voutLocBox.Text;
            Settings.Default.VideoType = videoTypeBox.SelectedItem as string;

            //save all the user settings.
            Settings.Default.Save();

            //MessageBox.Show("Application must be restarted inorder to apply the changes", "Restart", 
            //    MessageBoxButtons.OKCancel, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, 
            //    MessageBoxOptions.ServiceNotification);
            if (MessageBox.Show("Application must be restarted inorder to apply the changes", "Restart", "Cancel") == YesNo.Yes)
            {
                Application.Restart();
            }
            //Settings.Default.Opacity = (decimal)OpacityBar.Value/10;
        }

24. Example

Project: Mid2BMS
Source File: Form1.cs
private void button21_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("???????????????????????????", "confirm", MessageBoxButtons.OKCancel) == System.Windows.Forms.DialogResult.OK)
            {
                checkBox_InitForm.Checked = true;
                Application.Restart();
                // ??????????????????
            }
        }

25. Example

Project: Zero-K-Infrastructure
Source File: Program.cs
public static void Restart() {
            CloseOnNext = true;
            FinalizeShutdown();
            //Thread.Sleep(5000);
            Application.Restart();
        }

26. Example

Project: SimplyU
Source File: dev_gui.cs
private void btn_reset_Click(object sender, EventArgs e)
        {
            DialogResult dr = MessageBox.Show("This option will reset all Settings to their defaults! \r\n        Are you sure you want to continue?", "SimpliiU: Properties -- Reset", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button2);
            switch (dr)
            {
                case System.Windows.Forms.DialogResult.Yes:
                    Properties.Settings.Default.Reset();
                    Application.Restart();
                    break;

                case System.Windows.Forms.DialogResult.No:

                    break;
            }
        }

27. Example

Project: SimplyU
Source File: dev_properties.cs
private void btn_reset_Click(object sender, EventArgs e)
        {
            DialogResult dr = MessageBox.Show("This option will reset all Settings to their defaults! \r\n        Are you sure you want to continue?", "SimpliiU: Properties -- Reset", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button2);
            switch (dr)
            {
                case System.Windows.Forms.DialogResult.Yes:
                    Properties.Settings.Default.Reset();
                    Application.Restart();
                    break;

                case System.Windows.Forms.DialogResult.No:

                    break;
            }
        }

28. Example

Project: Gallifrey
Source File: ModelHelpers.cs
public void CloseApp(bool restart = false)
        {
            if (restart && Gallifrey.VersionControl.IsAutomatedDeploy)
            {
                System.Windows.Forms.Application.Restart();
            }

            Application.Current.Shutdown();
        }

29. Example

Project: ImageGlass
Source File: ctlMain.cs
private void btnApply_Click(object sender, EventArgs e)
        {
            if (lvTheme.SelectedItems.Count > 0)
            {
                ImageGlass.Theme.Theme th = new ImageGlass.Theme.Theme();
                th.ApplyTheme(lvTheme.SelectedItems[0].Tag.ToString());
               
                DialogResult msg = MessageBox.Show("Restart ImageGlass to complete the new theme applying ?", 
                    "Restart", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (msg == DialogResult.Yes)
                {
                    Application.Restart();
                }
            }
        }

30. Example

Project: mptanks2d
Source File: GameBuilder.cs
public void Restart()
        {
            System.Windows.Forms.Application.Restart();
            System.Windows.Forms.Application.Exit();
            Exit();
        }

31. Example

Project: QPAS
Source File: SettingsWindow.xaml.cs
private async void SaveBtn_Click(object sender, RoutedEventArgs e)
        {
            //have to save the passwords here
            //because binding securely is basically impossible
            Properties.Settings.Default.mySqlPassword = DBUtils.Protect(MySqlPasswordBox.Password);
            Properties.Settings.Default.sqlitePassword = DBUtils.Protect(SqlitePasswordBox.Password);
            Properties.Settings.Default.sqlServerPassword = DBUtils.Protect(SqlServerPassword.Password);

            Properties.Settings.Default.Save();

            ViewModel.Save();

            await this.ShowMessageAsync("Restarting", "Settings saved. Restarting application.");

            System.Windows.Forms.Application.Restart();
            Environment.Exit(0);
        }

32. Example

Project: ynoteclassic
Source File: Options.cs
private void button6_Click(object sender, EventArgs e)
        {
            var result =
                MessageBox.Show(
                    "You will need to restart the application for changes to take place.\nDo you want to continue ? ",
                    "", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
            if (result == DialogResult.Yes)
            {
                File.Delete(GlobalSettings.SettingsDir + "User.ynotesettings");
                Application.Restart();
            }
        }

33. Example

Project: LiteDevelop
Source File: ExtensionsDialog.cs
private void closeButton_Click(object sender, EventArgs e)
        {
            if (_hasRemovedExtensions)
            {
                if (MessageBox.Show(LiteDevelopApplication.Current.MuiProcessor.GetString("ExtensionsDialog.RestartRequired"), "LiteDevelop", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == System.Windows.Forms.DialogResult.Yes)
                {
                    Application.Restart();
                }
            }
            Close();
        }

34. Example

Project: DotSpatial
Source File: Updater.cs
private void DeploymentUpdateCompleted(object sender, AsyncCompletedEventArgs e)
        {
            if (e.Error != null)
            {
                Trace.WriteLine(e.Error);
            }

            if (_versionInfo.IsUpdateRequired)
            {
                MessageBox.Show(MessageStrings.ApplicationUpgradeRestartNow);
                Application.Restart();
            }
            else
            {
                UpdateProgress(MessageStrings.UpdateInstalled);
            }
        }

35. Example

Project: Kalman.Studio
Source File: DatabaseSettingForm.cs
private void btnSave_Click(object sender, EventArgs e)
        {
            var connectName = cbConnectStringName.Text.Trim();
            var providerName = cbProviderName.Text.Trim();
            var connectString = txtConnectString.Text.Trim();

            if (string.IsNullOrEmpty(connectName))
            {
                MessageBox.Show("???????????");
                return;
            }

            if (string.IsNullOrEmpty(providerName))
            {
                MessageBox.Show("???Provider???");
                return;
            }

            if (string.IsNullOrEmpty(connectString))
            {
                MessageBox.Show("???ConnectString???");
                return;
            }

            try
            {
                ConnectionStringUtil.UpdateConnectionString(connectName, connectString, providerName);

                this.DialogResult = DialogResult.Yes;
                MessageBox.Show("???????????");
                System.Windows.Forms.Application.Restart();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "??", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.DialogResult = DialogResult.No;
            }
        }

36. Example

Project: PoshSecFramework
Source File: frmMain.cs
private void ShowOptions()
        {
            if (lvwActiveScripts.Items.Count == 0)
            {
                schedule.Pause();
                poshsecframework.Interface.frmSettings frm = new poshsecframework.Interface.frmSettings();
                System.Windows.Forms.DialogResult rslt = frm.ShowDialog();
                bool restart = frm.Restart;
                frm.Dispose();
                frm = null;
                if (rslt == System.Windows.Forms.DialogResult.OK)
                {
                    psf.Close();
                    if (restart)
                    {
                        if (MessageBox.Show(StringValue.RestartRequired, "Restart?", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
                        {
                            Application.Restart();
                            this.Close();
                        }
                        else
                        {
                            psf.Open();
                        }
                    }
                    else
                    {
                        psf.Open();
                        Initialize();
                    }
                }
                schedule.Resume();
            }
            else
            {
                MessageBox.Show(StringValue.SettingScriptsRunning);
            }
        }

37. Example

Project: ynoteclassic
Source File: PackageDownloader.cs
private void InstallPackage(string file)
        {
            // var installer = new PackageInstaller(file);
            // installer.ShowDialog(this);
            if (admin)
            {
                var info = new ProcessStartInfo(Application.StartupPath + @"\pkmgr.exe", file);
                info.Verb = "runas";
                Process.Start(info);
                DialogResult result = MessageBox.Show("Package Successfully Installed. Restart now to make changes ?", "", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
                if (result == DialogResult.Yes)
                    Application.Restart();
                Close();
            }
            else
            {
                new PackageInstaller(file).Show(this);
            }
        }

38. Example

Project: SceneNavi
Source File: MainForm.cs
private void enableAntiAliasingToolStripMenuItem_Click(object sender, EventArgs e)
        {
            /* Determine anti-aliasing status */
            if (Configuration.EnableAntiAliasing = ((ToolStripMenuItem)sender).Checked)
            {
                int samples = 0;
                GL.GetInteger(GetPName.MaxSamples, out samples);
                Configuration.AntiAliasingSamples = samples;
            }
            else
                Configuration.AntiAliasingSamples = 0;

            if (MessageBox.Show(string.Format("{0}abling anti-aliasing requires restarting SceneNavi.\n\nDo you want to restart the program now?", (Configuration.EnableAntiAliasing ? "En" : "Dis")),
                "Question", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
            {
                Configuration.IsRestarting = true;
                Application.Restart();
            }
        }

39. Example

Project: tesvsnip
Source File: MainView.cs
private void resetSettingsToDefaultsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var conf = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.PerUserRoamingAndLocal);
            string pathUserConfig = conf.FilePath;
            try
            {
                if (File.Exists(pathUserConfig))
                {
                    File.Delete(pathUserConfig);
                    Application.Restart();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Tesvsnip", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }

40. Example

Project: falloutsnip
Source File: MainView.cs
private void resetSettingsToDefaultsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var conf = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.PerUserRoamingAndLocal);
            string pathUserConfig = conf.FilePath;
            try
            {
                if (File.Exists(pathUserConfig))
                {
                    File.Delete(pathUserConfig);
                    Application.Restart();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "FalloutSnip", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }

41. Example

Project: AlwaysOnTop
Source File: FormSettings.cs
private void btnApply_Click(object sender, EventArgs e)
		{
			using (RegistryKey regSettings = Regi/n ..... /n //View Source file for more details /n }

42. Example

Project: XrmToolBox
Source File: Store.cs
public void PerformUninstallation(PluginDeletions deletions)
        {
            string filePath = Path.Combine(Paths.XrmToolBoxPath, "Deletion.xml");

            if (File.Exists(filePath))
            {
                using (StreamReader reader = new StreamReader(filePath))
                {
                    var existingPds = (PluginDeletions) XmlSerializerHelper.Deserialize(reader.ReadToEnd(), typeof(PluginDeletions));
                    deletions.Plugins.AddRange(existingPds.Plugins);
                }
            }
            
            XmlSerializerHelper.SerializeToFile(deletions, filePath);

            if (DialogResult.Yes == MessageBox.Show(
                "This application needs to restart to remove plugins. Click Yes to restart this application now",
                "Information", MessageBoxButtons.YesNo, MessageBoxIcon.Information))
            {
                Application.Restart();
            }
        }

43. Example

Project: XrmToolBox
Source File: StoreFromPortal.cs
public void PerformUninstallation(PluginDeletions deletions)
        {
            string filePath = Path.Combine(Paths.XrmToolBoxPath, "Deletion.xml");

            if (File.Exists(filePath))
            {
                using (StreamReader reader = new StreamReader(filePath))
                {
                    var existingPds = (PluginDeletions)XmlSerializerHelper.Deserialize(reader.ReadToEnd(), typeof(PluginDeletions));
                    deletions.Plugins.AddRange(existingPds.Plugins);
                }
            }

            XmlSerializerHelper.SerializeToFile(deletions, filePath);

            if (DialogResult.Yes == MessageBox.Show(
                "This application needs to restart to remove plugins. Click Yes to restart this application now",
                "Information", MessageBoxButtons.YesNo, MessageBoxIcon.Information))
            {
                Application.Restart();
            }
        }

44. Example

Project: osu-Sync
Source File: Window_Settings.xaml.cs
public void Bu_ToolReset_Click(object sender, RoutedEventArgs e) {
			if(MessageBox.Show(GlobalVar._e("WindowSettings_areYouSureYouWantToReset"), GlobalVar.appName, MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No) == MessageBoxResult.Yes) {
                GlobalVar.FileAssociationsDelete();
				if(Directory.Exists(GlobalVar.appDataPath)) {
					try {
						Directory.Delete(GlobalVar.appDataPath, true);
					} catch (IOException) {}
				}
				if(Directory.Exists(GlobalVar.appTempPath)) {
					try {
						Directory.Delete(GlobalVar.appTempPath, true);
					} catch (IOException) {}
				}
				if(MessageBox.Show(GlobalVar._e("WindowSettings_okDoneDoYouWantToRestart"), GlobalVar.appName, MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.Yes) == MessageBoxResult.Yes)
					System.Windows.Forms.Application.Restart();
				System.Windows.Application.Current.Shutdown();
			}
		}

45. Example

Project: OptiKey
Source File: App.xaml.cs
private static void HandleCorruptSettings()
        {
            try
            {
                //Attempting to read a setting from a corrupt user config file throws an exception
                var upgradeRequired = Settings.Default.SettingsUpgradeRequired;
            }
            catch (ConfigurationErrorsException cee)
            {
                Log.Warn("User settings file is corrupt and needs to be corrected. Alerting user and shutting down.");
                string filename = ((ConfigurationErrorsException)cee.InnerException).Filename;

                if (MessageBox.Show(
                        OptiKey.Properties.Resources.CORRUPTED_SETTINGS_MESSAGE,
                        OptiKey.Properties.Resources.CORRUPTED_SETTINGS_TITLE,
                        MessageBoxButton.YesNo,
                        MessageBoxImage.Error) == MessageBoxResult.Yes)
                {
                    File.Delete(filename);
                    try
                    {
                        System.Windows.Forms.Application.Restart();
                    }
                    catch {} //Swallow any exceptions (e.g. DispatcherExceptions) - we're shutting down so it doesn't matter.
                }
                Current.Shutdown(); //Avoid the inevitable crash by shutting down gracefully
            }
        }

46. Example

Project: babysmash
Source File: Controller.cs
public void ShowOptionsDialog()
        {
            bool foo = Settings.Default.TransparentBackground;
            isOptionsDialogShown = true;
            var o = new Options();
            Mouse.Capture(null);
            foreach (MainWindow m in this.windows)
            {
                m.Topmost = false;
            }
            o.Topmost = true;
            o.Focus();
            o.ShowDialog();
            Debug.Write("test");
            foreach (MainWindow m in this.windows)
            {
                m.Topmost = true;
                //m.ResetCanvas();
            }
            isOptionsDialogShown = false;

            if (foo != Settings.Default.TransparentBackground)
            {
                MessageBoxResult result = MessageBox.Show(
                        "You've changed the Window Transparency Option. We'll need to restart BabySmash! for you to see the change. Pressing YES will restart BabySmash!. Is that OK?",
                        "Need to Restart", MessageBoxButton.YesNo, MessageBoxImage.Question);
                if (result == MessageBoxResult.Yes)
                {
                    Application.Current.Shutdown();
                    System.Windows.Forms.Application.Restart();
                }
            }
        }

47. Example

Project: ynoteclassic
Source File: PackageInstaller.cs
private void _time_Tick(object sender, EventArgs e)
        {
            _time.Stop();
            if (YnotePackageManager.InstallPackage(_package))
            {
                progressBar1.Value = 100;
                var result = MessageBox.Show("Package Installed Successfully ? Restart now to make changes ?",
                    "Package Installer",
                    MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (result == DialogResult.Yes)
                    Application.Restart();
            }
            else
                MessageBox.Show("There was an Error Installing the Package");
            Close();
        }

48. Example

Project: SimplyU
Source File: dev_preview_theme.cs
private void dev_preview_theme_Load(object sender, EventArgs e)
        {
            try
          /n ..... /n //View Source file for more details /n }

49. Example

Project: SimplyU
Source File: dev_spash.cs
private void dev_spash_Load(object sender, EventArgs e)
        {
            try
            {
    /n ..... /n //View Source file for more details /n }

50. Example

Project: HaSuite
Source File: Program.cs
[STAThread]
        static void Main()
        {
            // Startup
#if !DEBUG
            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
#endif

            Properties.Resources.Culture = CultureInfo.CurrentCulture;
            InfoManager = new WzInformationManager();
            SettingsManager = new WzSettingsManager(GetLocalSettingsPath(), typeof(UserSettings), typeof(ApplicationSettings), typeof(Microsoft.Xna.Framework.Color));
            SettingsManager.Load();
            MultiBoard.RecalculateSettings();
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);

            // Program run here
            GUI.Initialization initForm = new GUI.Initialization();
            Application.Run(initForm);

            // Shutdown
            if (initForm.editor != null)
                initForm.editor.hcsm.backupMan.ClearBackups();
            SettingsManager.Save();
            if (Restarting)
            {
                Application.Restart();
            }
        }