public void Email() { FormProgress.SetTitle("Chill-Out for a few seconds...\nPreparing Presentation for Email..."); FormProgress.ShowProgress(); var tempFileName = Path.Combine(Core.Common.ResourceManager.Instance.TempFolder.LocalPath, Path.GetFileName(Path.GetTempFileName())); AdSchedulePowerPointHelper.Instance.PrepareMultiSummaryEmail(tempFileName); FormProgress.CloseProgress(); if (!File.Exists(tempFileName)) { return; } using (var formEmail = new FormEmail(AdSchedulePowerPointHelper.Instance, BusinessObjects.Instance.HelpManager)) { formEmail.Text = "Email this Multi-Publication Analysis"; formEmail.LoadGroups(new[] { new PreviewGroup { Name = "Preview", PresentationSourcePath = tempFileName } }); Utilities.Instance.ActivateForm(Controller.Instance.FormMain.Handle, true, false); RegistryHelper.MainFormHandle = formEmail.Handle; RegistryHelper.MaximizeMainForm = false; formEmail.ShowDialog(); RegistryHelper.MaximizeMainForm = Controller.Instance.FormMain.WindowState == FormWindowState.Maximized; RegistryHelper.MainFormHandle = Controller.Instance.FormMain.Handle; } }
protected override void ShowEmail(string tempFileName) { using (var formEmail = new FormEmail(AdSchedulePowerPointHelper.Instance, BusinessObjects.Instance.HelpManager)) { formEmail.Text = "Email this Summary"; formEmail.LoadGroups(new[] { new PreviewGroup { Name = "Preview", PresentationSourcePath = tempFileName } }); Utilities.Instance.ActivateForm(Controller.Instance.FormMain.Handle, true, false); RegistryHelper.MainFormHandle = formEmail.Handle; RegistryHelper.MaximizeMainForm = false; formEmail.ShowDialog(); RegistryHelper.MaximizeMainForm = true; RegistryHelper.MainFormHandle = Controller.Instance.FormMain.Handle; } }
protected override void EmailInternal(IEnumerable <CalendarOutputData> outputData) { if (outputData == null) { return; } var commonOutputData = outputData.OfType <AdCalendarOutputData>(); var previewGroups = new List <PreviewGroup>(); FormProgress.SetTitle("Chill-Out for a few seconds...\nPreparing Calendar for Email..."); FormProgress.ShowProgress(); Enabled = false; foreach (var outputItem in commonOutputData) { var previewGroup = new PreviewGroup { Name = outputItem.MonthText, PresentationSourcePath = Path.Combine(Core.Common.ResourceManager.Instance.TempFolder.LocalPath, Path.GetFileName(Path.GetTempFileName())) }; AdSchedulePowerPointHelper.Instance.PrepareCalendarEmail(previewGroup.PresentationSourcePath, new[] { outputItem }); previewGroups.Add(previewGroup); } Enabled = true; FormProgress.CloseProgress(); if (!(previewGroups.Any() && previewGroups.All(pg => File.Exists(pg.PresentationSourcePath)))) { return; } using (var formEmail = new FormEmail(AdSchedulePowerPointHelper.Instance, BusinessObjects.Instance.HelpManager)) { formEmail.Text = "Email this Calendar"; formEmail.LoadGroups(previewGroups); Utilities.Instance.ActivateForm(Controller.Instance.FormMain.Handle, true, 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 void Email() { FormProgress.SetTitle("Chill-Out for a few seconds...\nPreparing Presentation for Email..."); FormProgress.ShowProgress(); var tempFileName = Path.Combine(Core.Common.ResourceManager.Instance.TempFolder.LocalPath, Path.GetFileName(Path.GetTempFileName())); AdSchedulePowerPointHelper.Instance.PrepareMultiSummaryEmail(tempFileName); FormProgress.CloseProgress(); if (!File.Exists(tempFileName)) return; using (var formEmail = new FormEmail(AdSchedulePowerPointHelper.Instance, BusinessObjects.Instance.HelpManager)) { formEmail.Text = "Email this Multi-Publication Analysis"; formEmail.LoadGroups(new[] { new PreviewGroup { Name = "Preview", PresentationSourcePath = tempFileName } }); Utilities.Instance.ActivateForm(Controller.Instance.FormMain.Handle, true, 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 void Email() { Save(); var tabPages = xtraTabControlPublications.TabPages.Where(tabPage => tabPage.PageEnabled).OfType <IBasicOverviewOutputControl>(); var selectedProducts = new List <IBasicOverviewOutputControl>(); if (tabPages.Count() > 1) { using (var form = new FormSelectOutputItems()) { form.Text = "Select Products"; var currentProduct = xtraTabControlPublications.SelectedTabPage as IBasicOverviewOutputControl; foreach (var tabPage in tabPages) { var item = new CheckedListBoxItem(tabPage, tabPage.SlideName); form.checkedListBoxControlOutputItems.Items.Add(item); if (tabPage == currentProduct) { form.buttonXSelectCurrent.Tag = item; } } form.checkedListBoxControlOutputItems.CheckAll(); if (form.ShowDialog() == DialogResult.OK) { selectedProducts.AddRange(form.checkedListBoxControlOutputItems.Items. OfType <CheckedListBoxItem>(). Where(ci => ci.CheckState == CheckState.Checked). Select(ci => ci.Value). OfType <IBasicOverviewOutputControl>()); } } } else { selectedProducts.AddRange(tabPages); } if (!selectedProducts.Any()) { return; } var previewGroups = new List <PreviewGroup>(); FormProgress.SetTitle("Chill-Out for a few seconds...\nPreparing Presentation for Email..."); FormProgress.ShowProgress(); foreach (var productControl in selectedProducts) { var previewGroup = productControl.GetPreviewGroup(); if (productControl is PublicationBasicOverviewControl) { AdSchedulePowerPointHelper.Instance.PrepareBasicOverviewEmail(previewGroup.PresentationSourcePath, new[] { (PublicationBasicOverviewControl)productControl }); } else if (productControl is BasicOverviewSummaryControl) { var summaryControl = productControl as BasicOverviewSummaryControl; summaryControl.PopulateReplacementsList(); AdSchedulePowerPointHelper.Instance.PrepareBasicOverviewSummaryEmail(previewGroup.PresentationSourcePath, summaryControl); } previewGroups.Add(previewGroup); } FormProgress.CloseProgress(); if (!(previewGroups.Any() && previewGroups.All(pg => File.Exists(pg.PresentationSourcePath)))) { return; } using (var formEmail = new FormEmail(AdSchedulePowerPointHelper.Instance, BusinessObjects.Instance.HelpManager)) { formEmail.Text = "Email this Basic Overview"; formEmail.LoadGroups(previewGroups); Utilities.Instance.ActivateForm(Controller.Instance.FormMain.Handle, true, 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 void Email() { var tabPages = _tabPages; var selectedProducts = new List<PublicationDetailedGridControl>(); if (tabPages.Count() > 1) using (var form = new FormSelectOutputItems()) { form.Text = "Select Products"; var currentProduct = xtraTabControlPublications.SelectedTabPage as PublicationDetailedGridControl; foreach (var tabPage in tabPages) { var item = new CheckedListBoxItem(tabPage, tabPage.PrintProduct.Name); form.checkedListBoxControlOutputItems.Items.Add(item); if (tabPage == currentProduct) form.buttonXSelectCurrent.Tag = item; } form.checkedListBoxControlOutputItems.CheckAll(); if (form.ShowDialog() == DialogResult.OK) selectedProducts.AddRange(form.checkedListBoxControlOutputItems.Items. OfType<CheckedListBoxItem>(). Where(ci => ci.CheckState == CheckState.Checked). Select(ci => ci.Value). OfType<PublicationDetailedGridControl>()); } else selectedProducts.AddRange(tabPages); if (!selectedProducts.Any()) return; var tempFileName = Path.Combine(Core.Common.ResourceManager.Instance.TempFolder.LocalPath, Path.GetFileName(Path.GetTempFileName())); FormProgress.SetTitle("Chill-Out for a few seconds...\nPreparing Presentation for Email..."); FormProgress.ShowProgress(); foreach (var product in selectedProducts) product.PrepareOutput(); AdSchedulePowerPointHelper.Instance.PrepareDetailedGridGridBasedEmail(tempFileName, selectedProducts.ToArray()); FormProgress.CloseProgress(); if (!File.Exists(tempFileName)) return; using (var formEmail = new FormEmail(AdSchedulePowerPointHelper.Instance, BusinessObjects.Instance.HelpManager)) { formEmail.Text = "Email this Detailed Advertising Grid"; formEmail.LoadGroups(new[] { new PreviewGroup { Name = "Preview", PresentationSourcePath = tempFileName } }); Utilities.Instance.ActivateForm(Controller.Instance.FormMain.Handle, true, 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 void Email() { Save(); var tabPages = xtraTabControlPublications.TabPages.Where(tabPage => tabPage.PageEnabled).OfType<IBasicOverviewOutputControl>(); var selectedProducts = new List<IBasicOverviewOutputControl>(); if (tabPages.Count() > 1) using (var form = new FormSelectOutputItems()) { form.Text = "Select Products"; var currentProduct = xtraTabControlPublications.SelectedTabPage as IBasicOverviewOutputControl; foreach (var tabPage in tabPages) { var item = new CheckedListBoxItem(tabPage, tabPage.SlideName); form.checkedListBoxControlOutputItems.Items.Add(item); if (tabPage == currentProduct) form.buttonXSelectCurrent.Tag = item; } form.checkedListBoxControlOutputItems.CheckAll(); if (form.ShowDialog() == DialogResult.OK) selectedProducts.AddRange(form.checkedListBoxControlOutputItems.Items. OfType<CheckedListBoxItem>(). Where(ci => ci.CheckState == CheckState.Checked). Select(ci => ci.Value). OfType<IBasicOverviewOutputControl>()); } else selectedProducts.AddRange(tabPages); if (!selectedProducts.Any()) return; var previewGroups = new List<PreviewGroup>(); FormProgress.SetTitle("Chill-Out for a few seconds...\nPreparing Presentation for Email..."); FormProgress.ShowProgress(); foreach (var productControl in selectedProducts) { var previewGroup = productControl.GetPreviewGroup(); if (productControl is PublicationBasicOverviewControl) AdSchedulePowerPointHelper.Instance.PrepareBasicOverviewEmail(previewGroup.PresentationSourcePath, new[] { (PublicationBasicOverviewControl)productControl }); else if (productControl is BasicOverviewSummaryControl) { var summaryControl = productControl as BasicOverviewSummaryControl; summaryControl.PopulateReplacementsList(); AdSchedulePowerPointHelper.Instance.PrepareBasicOverviewSummaryEmail(previewGroup.PresentationSourcePath, summaryControl); } previewGroups.Add(previewGroup); } FormProgress.CloseProgress(); if (!(previewGroups.Any() && previewGroups.All(pg => File.Exists(pg.PresentationSourcePath)))) return; using (var formEmail = new FormEmail(AdSchedulePowerPointHelper.Instance, BusinessObjects.Instance.HelpManager)) { formEmail.Text = "Email this Basic Overview"; formEmail.LoadGroups(previewGroups); Utilities.Instance.ActivateForm(Controller.Instance.FormMain.Handle, true, false); RegistryHelper.MainFormHandle = formEmail.Handle; RegistryHelper.MaximizeMainForm = false; formEmail.ShowDialog(); RegistryHelper.MaximizeMainForm = Controller.Instance.FormMain.WindowState == FormWindowState.Maximized; RegistryHelper.MainFormHandle = Controller.Instance.FormMain.Handle; } }
protected override void EmailInternal(IEnumerable<CalendarOutputData> outputData) { if (outputData == null) return; var commonOutputData = outputData.OfType<AdCalendarOutputData>(); var previewGroups = new List<PreviewGroup>(); FormProgress.SetTitle("Chill-Out for a few seconds...\nPreparing Calendar for Email..."); FormProgress.ShowProgress(); Enabled = false; foreach (var outputItem in commonOutputData) { var previewGroup = new PreviewGroup { Name = outputItem.MonthText, PresentationSourcePath = Path.Combine(Core.Common.ResourceManager.Instance.TempFolder.LocalPath, Path.GetFileName(Path.GetTempFileName())) }; AdSchedulePowerPointHelper.Instance.PrepareCalendarEmail(previewGroup.PresentationSourcePath, new[] { outputItem }); previewGroups.Add(previewGroup); } Enabled = true; FormProgress.CloseProgress(); if (!(previewGroups.Any() && previewGroups.All(pg => File.Exists(pg.PresentationSourcePath)))) return; using (var formEmail = new FormEmail(AdSchedulePowerPointHelper.Instance, BusinessObjects.Instance.HelpManager)) { formEmail.Text = "Email this Calendar"; formEmail.LoadGroups(previewGroups); Utilities.Instance.ActivateForm(Controller.Instance.FormMain.Handle, true, false); RegistryHelper.MainFormHandle = formEmail.Handle; RegistryHelper.MaximizeMainForm = false; formEmail.ShowDialog(); RegistryHelper.MaximizeMainForm = Controller.Instance.FormMain.WindowState == FormWindowState.Maximized; RegistryHelper.MainFormHandle = Controller.Instance.FormMain.Handle; } }