public void Email() { var selectedSlideMaster = _slideContainer.SelectedSlide; if (selectedSlideMaster == null) return; FormProgress.SetTitle("Chill-Out for a few seconds...\nPreparing Preview..."); FormProgress.ShowProgress(); var tempFileName = Path.Combine(Common.Core.Configuration.ResourceManager.Instance.TempFolder.LocalPath, Path.GetFileName(Path.GetTempFileName())); RegularMediaSchedulePowerPointHelper.Instance.PreparePresentation(tempFileName, presentation => RegularMediaSchedulePowerPointHelper.Instance.AppendSlideMaster(selectedSlideMaster.GetMasterPath(), presentation)); Utilities.ActivateForm(Controller.Instance.FormMain.Handle, Controller.Instance.FormMain.WindowState == FormWindowState.Maximized, false); FormProgress.CloseProgress(); using (var formEmail = new FormEmail(RegularMediaSchedulePowerPointHelper.Instance, BusinessObjects.Instance.HelpManager)) { formEmail.Text = "Email this Slide"; formEmail.LoadGroups(new[] { new PreviewGroup { Name = "Preview", PresentationSourcePath = tempFileName } }); Utilities.ActivateForm(Controller.Instance.FormMain.Handle, Controller.Instance.FormMain.WindowState == FormWindowState.Maximized, false); RegistryHelper.MainFormHandle = formEmail.Handle; RegistryHelper.MaximizeMainForm = false; formEmail.ShowDialog(); RegistryHelper.MaximizeMainForm = Controller.Instance.FormMain.WindowState == FormWindowState.Maximized; RegistryHelper.MainFormHandle = Controller.Instance.FormMain.Handle; } }
public override void Email() { var slides = GetOutputSlides(); if (!slides.Any()) return; FormProgress.SetTitle("Chill-Out for a few seconds...\nPreparing Solution..."); FormProgress.ShowProgress(); var previewGroups = slides.Select(s => s.GeneratePreview()).ToList(); Utilities.ActivateForm(Controller.Instance.FormMain.Handle, Controller.Instance.FormMain.WindowState == FormWindowState.Maximized, false); FormProgress.CloseProgress(); if (!(previewGroups.Any() && previewGroups.All(pg => File.Exists(pg.PresentationSourcePath)))) return; using (var formEmail = new FormEmail(RegularMediaSchedulePowerPointHelper.Instance, BusinessObjects.Instance.HelpManager)) { formEmail.Text = "Email this Schedule"; formEmail.LoadGroups(previewGroups); Utilities.ActivateForm(Controller.Instance.FormMain.Handle, Controller.Instance.FormMain.WindowState == FormWindowState.Maximized, false); RegistryHelper.MainFormHandle = formEmail.Handle; RegistryHelper.MaximizeMainForm = false; formEmail.ShowDialog(); RegistryHelper.MaximizeMainForm = Controller.Instance.FormMain.WindowState == FormWindowState.Maximized; RegistryHelper.MainFormHandle = Controller.Instance.FormMain.Handle; } }