public void Preview() { FormProgress.SetTitle("Chill-Out for a few seconds...\nPreparing Preview..."); FormProgress.ShowProgress(); string tempFileName = Path.Combine(ResourceManager.Instance.TempFolder.LocalPath, Path.GetFileName(Path.GetTempFileName())); DashboardPowerPointHelper.Instance.PrepareCleanslateEmail(tempFileName); Utilities.ActivateForm(FormMain.Instance.Handle, false, false); FormProgress.CloseProgress(); if (!File.Exists(tempFileName)) return; using (var formPreview = new FormPreview(FormMain.Instance, DashboardPowerPointHelper.Instance, AppManager.Instance.HelpManager, AppManager.Instance.ShowFloater)) { formPreview.Text = "Preview Slides"; formPreview.LoadGroups(new[] { new PreviewGroup { Name = "Preview", PresentationSourcePath = tempFileName } }); RegistryHelper.MainFormHandle = formPreview.Handle; RegistryHelper.MaximizeMainForm = false; var previewResult = formPreview.ShowDialog(); RegistryHelper.MaximizeMainForm = false; RegistryHelper.MainFormHandle = FormMain.Instance.Handle; if (previewResult != DialogResult.OK) AppManager.Instance.ActivateMainForm(); } }
private void GeneratePreview(SlideMaster slideMaster) { if (!AppManager.Instance.CheckPowerPointRunning()) 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())); DashboardPowerPointHelper.Instance.PreparePresentation(tempFileName, presentation => DashboardPowerPointHelper.Instance.AppendSlideMaster(slideMaster.GetMasterPath(), presentation)); Utilities.ActivateForm(FormMain.Instance.Handle, false, false); FormProgress.CloseProgress(); if (!File.Exists(tempFileName)) return; using (var formPreview = new FormPreview(FormMain.Instance, DashboardPowerPointHelper.Instance, AppManager.Instance.HelpManager, AppManager.Instance.ShowFloater)) { formPreview.Text = "Preview Slides"; formPreview.LoadGroups(new[] { new PreviewGroup { Name = "Preview", PresentationSourcePath = tempFileName } }); RegistryHelper.MainFormHandle = formPreview.Handle; RegistryHelper.MaximizeMainForm = false; var previewResult = formPreview.ShowDialog(); RegistryHelper.MaximizeMainForm = false; RegistryHelper.MainFormHandle = FormMain.Instance.Handle; if (previewResult != DialogResult.OK) AppManager.Instance.ActivateMainForm(); } }
public PreviewGroupControl( OutputGroup outputGroup, PowerPointProcessor mainPowerPointProcessor, Form parentForm, FormPreview previewForm) { OutputGroup = outputGroup; _mainPowerPointProcessor = mainPowerPointProcessor; _parentForm = parentForm; _previewForm = previewForm; InitializeComponent(); Text = OutputGroup.Name; FormProgress.Init(_parentForm); xtraTabControlItems.TabPages.AddRange(outputGroup.Items.Select(previewItem => new PreviewItemControl(previewItem)).ToArray()); xtraTabControlItems.ShowTabHeader = xtraTabControlItems.TabPages.Count > 1 ? DefaultBoolean.True : DefaultBoolean.False; xtraTabControlItems.SelectedTabPage = xtraTabControlItems.TabPages .OfType <PreviewItemControl>() .FirstOrDefault(previewControl => previewControl.OutputItem.IsCurrent) ?? xtraTabControlItems.SelectedTabPage; xtraTabControlItems.SelectedPageChanged += OnSelectedPreviewItemChanged; }
private void Preview(SlideMaster slideMaster) { 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(slideMaster.GetMasterPath(), presentation)); Utilities.ActivateForm(Controller.Instance.FormMain.Handle, Controller.Instance.FormMain.WindowState == FormWindowState.Maximized, false); FormProgress.CloseProgress(); using (var formPreview = new FormPreview( Controller.Instance.FormMain, RegularMediaSchedulePowerPointHelper.Instance, BusinessObjects.Instance.HelpManager, Controller.Instance.ShowFloater)) { formPreview.Text = "Preview Slide"; formPreview.LoadGroups(new[] { new PreviewGroup { Name = "Preview", PresentationSourcePath = tempFileName } }); RegistryHelper.MainFormHandle = formPreview.Handle; RegistryHelper.MaximizeMainForm = false; var previewResult = formPreview.ShowDialog(); RegistryHelper.MaximizeMainForm = Controller.Instance.FormMain.WindowState == FormWindowState.Maximized; RegistryHelper.MainFormHandle = Controller.Instance.FormMain.Handle; if (previewResult != DialogResult.OK) Utilities.ActivateForm(Controller.Instance.FormMain.Handle, Controller.Instance.FormMain.WindowState == FormWindowState.Maximized, false); } }
public override void Preview() { var slides = GetOutputSlides(); if (!slides.Any()) return; FormProgress.SetTitle("Chill-Out for a few seconds...\nPreparing Preview..."); 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 formPreview = new FormPreview( Controller.Instance.FormMain, RegularMediaSchedulePowerPointHelper.Instance, BusinessObjects.Instance.HelpManager, Controller.Instance.ShowFloater)) { formPreview.Text = "Preview Solution"; formPreview.LoadGroups(previewGroups); RegistryHelper.MainFormHandle = formPreview.Handle; RegistryHelper.MaximizeMainForm = false; var previewResult = formPreview.ShowDialog(); RegistryHelper.MaximizeMainForm = Controller.Instance.FormMain.WindowState == FormWindowState.Maximized; RegistryHelper.MainFormHandle = Controller.Instance.FormMain.Handle; if (previewResult != DialogResult.OK) Utilities.ActivateForm(Controller.Instance.FormMain.Handle, Controller.Instance.FormMain.WindowState == FormWindowState.Maximized, false); } }
public void Preview() { SaveChanges(); 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())); if (checkEditUseEmptyCover.Checked) DashboardPowerPointHelper.Instance.PrepareGenericCover(tempFileName); else DashboardPowerPointHelper.Instance.PrepareCover(tempFileName); Utilities.ActivateForm(FormMain.Instance.Handle, false, false); FormProgress.CloseProgress(); if (!File.Exists(tempFileName)) return; using (var formPreview = new FormPreview(FormMain.Instance, DashboardPowerPointHelper.Instance, AppManager.Instance.HelpManager, AppManager.Instance.ShowFloater)) { formPreview.Text = "Preview Slides"; formPreview.LoadGroups(new[] { new PreviewGroup { Name = "Preview", PresentationSourcePath = tempFileName, InsertOnTop = checkEditFirstSlide.Checked } }); RegistryHelper.MainFormHandle = formPreview.Handle; RegistryHelper.MaximizeMainForm = false; var previewResult = formPreview.ShowDialog(); RegistryHelper.MaximizeMainForm = false; RegistryHelper.MainFormHandle = FormMain.Instance.Handle; if (previewResult != DialogResult.OK) AppManager.Instance.ActivateMainForm(); } }