private void ThisAddIn_Shutdown(object sender, System.EventArgs e) { stageViewForm?.Dispose(); stageViewForm = null; Properties.Settings.Default.Save(); }
private void CloseStageView() { if (stageViewForm != null) { stageViewForm.NotifyClose(); stageViewForm = null; //stageViewForm.Close(); //stageViewForm.Dispose(); //stageViewForm = null; } }
private void RefreshStageView() { CloseStageView(); if (Application.SlideShowWindows.Count > 0 && Properties.Settings.Default.ShowStageView) { stageViewThread = new Thread(() => { stageViewForm = new StageViewForm(null); stageViewForm.SlideShowWindow = Application.SlideShowWindows[1]; System.Windows.Forms.Application.Run(stageViewForm); //var form = new Form1(); //System.Windows.Forms.Application.Run(form); }); stageViewThread.Start(); ////Showing a winform at this point causes Escape and Enter in the presenter view to have very strange behavior, so we delay the Show call. //Task.Run(async delegate //{ // await Task.Delay(200); // stageViewForm.Show(); //}); } }