コード例 #1
0
        private IList <OutputItem> GetOutputItems()
        {
            var selectedOutputItems = new List <OutputItem>();

            FormProgress.SetTitle("Chill-Out for a few seconds...\nPreparing Preview...");
            FormProgress.ShowProgress();
            var availableOutputGroups = xtraTabControlEditors.TabPages
                                        .OfType <IDigitalOutputContainer>()
                                        .Select(oc => oc.GetOutputGroup())
                                        .ToList();

            FormProgress.CloseProgress();

            if (!availableOutputGroups.Any())
            {
                return(selectedOutputItems);
            }

            using (var form = new FormPreview(
                       Controller.Instance.FormMain,
                       BusinessObjects.Instance.PowerPointManager.Processor))
            {
                form.LoadGroups(availableOutputGroups);
                if (form.ShowDialog() == DialogResult.OK)
                {
                    selectedOutputItems.AddRange(form.GetSelectedItems());
                }
            }

            return(selectedOutputItems);
        }
コード例 #2
0
        public void OnCustomSlidePreview(object sender, SlideMasterEventArgs e)
        {
            if (!CheckPowerPointRunning())
            {
                return;
            }
            if (e.SlideMaster == null)
            {
                return;
            }
            var previewGroup = new OutputGroup
            {
                Name      = e.SlideMaster.Name,
                IsCurrent = true,
                Items     = new List <OutputItem>(new[]
                {
                    new OutputItem
                    {
                        Name                   = e.SlideMaster.Name,
                        IsCurrent              = true,
                        SlidesCount            = 1,
                        PresentationSourcePath = Path.Combine(Asa.Common.Core.Configuration.ResourceManager.Instance.TempFolder.LocalPath,
                                                              Path.GetFileName(Path.GetTempFileName())),
                        SlideGeneratingAction = (processor, destinationPresentation) =>
                        {
                            var templatePath = e.SlideMaster.GetMasterPath();
                            processor.AppendSlideMaster(templatePath, destinationPresentation);
                        },
                        PreviewGeneratingAction = (processor, presentationSourcePath) =>
                        {
                            var templatePath = e.SlideMaster.GetMasterPath();
                            processor.PreparePresentation(presentationSourcePath,
                                                          presentation => processor.AppendSlideMaster(templatePath, presentation));
                        }
                    }
                })
            };

            var selectedOutputItems = new List <OutputItem>();

            using (var form = new FormPreview(
                       MainForm,
                       PowerPointProcessor))
            {
                form.LoadGroups(new[] { previewGroup });
                if (form.ShowDialog() == DialogResult.OK)
                {
                    selectedOutputItems.AddRange(form.GetSelectedItems());
                }
            }

            OutputPowerPointCustom(selectedOutputItems);
        }
コード例 #3
0
        public IList <OutputItem> GetOutputItems(bool onlyCurrentSlide)
        {
            var selectedOutputItems = new List <OutputItem>();

            var availableOutputGroups = new List <OutputGroup>();

            FormProgress.SetTitle("Chill-Out for a few seconds...\nLoading Slides...");
            FormProgress.ShowProgress(MainForm);
            if (onlyCurrentSlide)
            {
                if (ActiveSlide is IDashboardSlide dashboardSlide)
                {
                    availableOutputGroups.Add(dashboardSlide.GetOutputData());
                }
            }
            else
            {
                var allSlides = _slides
                                .OfType <IDashboardSlide>()
                                .ToList();

                foreach (var dashboardSlide in allSlides)
                {
                    availableOutputGroups.Add(dashboardSlide.GetOutputData());
                    Application.DoEvents();
                }
            }
            FormProgress.CloseProgress();

            if (!availableOutputGroups.Any())
            {
                return(selectedOutputItems);
            }

            using (var form = new FormPreview(
                       MainForm,
                       PowerPointProcessor))
            {
                form.LoadGroups(availableOutputGroups);
                if (form.ShowDialog() == DialogResult.OK)
                {
                    selectedOutputItems.AddRange(form.GetSelectedItems());
                }
            }

            return(selectedOutputItems);
        }
        private List <OutputItem> GetOutputItems(bool onlyCurrentSlide)
        {
            var selectedOutputItems = new List <OutputItem>();

            var availableOutputGroups = new List <OutputGroup>();

            FormProgress.SetTitle("Chill-Out for a few seconds...\nLoading Slides...");
            FormProgress.ShowProgress(Controller.Instance.FormMain);
            if (onlyCurrentSlide)
            {
                if (ActiveOptionSetContainer != null)
                {
                    availableOutputGroups.Add(ActiveOptionSetContainer.GetOutputGroup());
                }
            }
            else
            {
                var outputContainers = xtraTabControlContentEditors.TabPages
                                       .OfType <IOutputContainer>()
                                       .ToList();
                foreach (var outputContainer in outputContainers)
                {
                    availableOutputGroups.Add(outputContainer.GetOutputGroup());
                    Application.DoEvents();
                }
            }
            FormProgress.CloseProgress();

            if (!availableOutputGroups.Any())
            {
                return(selectedOutputItems);
            }

            using (var form = new FormPreview(
                       Controller.Instance.FormMain,
                       BusinessObjects.Instance.PowerPointManager.Processor))
            {
                form.LoadGroups(availableOutputGroups);
                if (form.ShowDialog() == DialogResult.OK)
                {
                    selectedOutputItems.AddRange(form.GetSelectedItems());
                }
            }

            return(selectedOutputItems);
        }
コード例 #5
0
        private IList <OutputItem> GetOutputItems(SlideMaster slideMaster = null)
        {
            var selectedSlideMaster = slideMaster ?? _slideContainer.SelectedSlide;
            var defaultOutputGroup  = new OutputGroup
            {
                Name      = "Preview",
                IsCurrent = true,
                Items     = new List <OutputItem>(new[]
                {
                    new OutputItem
                    {
                        Name                   = "Preview",
                        IsCurrent              = true,
                        SlidesCount            = 1,
                        PresentationSourcePath = Path.Combine(Common.Core.Configuration.ResourceManager.Instance.TempFolder.LocalPath,
                                                              Path.GetFileName(Path.GetTempFileName())),
                        SlideGeneratingAction = (processor, destinationPresentation) =>
                        {
                            var templatePath = selectedSlideMaster.GetMasterPath();
                            processor.AppendSlideMaster(templatePath, destinationPresentation);
                        },
                        PreviewGeneratingAction = (processor, presentationSourcePath) =>
                        {
                            var templatePath = selectedSlideMaster.GetMasterPath();
                            processor.PreparePresentation(presentationSourcePath,
                                                          presentation => processor.AppendSlideMaster(templatePath, presentation));
                        }
                    }
                })
            };

            var selectedOutputItems = new List <OutputItem>();

            using (var form = new FormPreview(
                       Controller.Instance.FormMain,
                       BusinessObjects.Instance.PowerPointManager.Processor))
            {
                form.LoadGroups(new[] { defaultOutputGroup });
                if (form.ShowDialog() == DialogResult.OK)
                {
                    selectedOutputItems.AddRange(form.GetSelectedItems());
                }
            }

            return(selectedOutputItems);
        }
コード例 #6
0
        public override void Email()
        {
            var currentMonth = CalendarView.SelectedMonthData;

            foreach (var month in ActiveCalendarSection.Months)
            {
                month.OutputData.PrepareNotes();
            }

            var monthOutputItems = ActiveCalendarSection.Months
                                   .Select(month => new CaledarMonthOutputItem(month)
            {
                IsCurrent = currentMonth == month
            })
                                   .ToList();
            var selectedOutputItems = new List <OutputItem>();
            var previewGroups       = GeneratePreviewData(monthOutputItems);

            if (previewGroups.Count > 1)
            {
                using (var form = new FormPreview(
                           FormMain,
                           PowerPointProcessor))
                {
                    form.LoadGroups(previewGroups);
                    if (form.ShowDialog() == DialogResult.OK)
                    {
                        selectedOutputItems.AddRange(form.GetSelectedItems());
                    }
                }
            }
            else
            {
                selectedOutputItems.AddRange(previewGroups.SelectMany(group => group.Items));
            }
            if (!selectedOutputItems.Any())
            {
                return;
            }
            EmailSlides(selectedOutputItems);
        }
コード例 #7
0
        protected IList <OutputItem> GetOutputItems(bool onlyCurrentSlide)
        {
            var selectedOutputItems = new List <OutputItem>();

            var availableOutputGroups = new List <OutputGroup>();

            FormProgress.SetTitle("Chill-Out for a few seconds...\nLoading Slides...");
            FormProgress.ShowProgress(MainForm);
            if (onlyCurrentSlide)
            {
                if (ActiveSlideContent != null)
                {
                    availableOutputGroups.Add(ActiveSlideContent.GetOutputGroup());
                }
            }
            else
            {
                var allSlides = _slides
                                .OfType <IShiftTabPageContainer>()
                                .ToList();

                foreach (var tabPageContainer in allSlides.Where(slide => slide.ContentControl == null).ToList())
                {
                    tabPageContainer.LoadContent();
                    if (tabPageContainer.ContentControl is MultiTabControl multiTabControl)
                    {
                        multiTabControl.LoadAllTabPages();
                        Application.DoEvents();
                    }
                }

                var contentControls = allSlides
                                      .Select(container => container.ContentControl)
                                      .ToList();
                foreach (var contentControl in contentControls)
                {
                    var outputGroup = contentControl.GetOutputGroup();
                    if (outputGroup.Items.Any())
                    {
                        availableOutputGroups.Add(outputGroup);
                    }
                    Application.DoEvents();
                }
            }
            FormProgress.CloseProgress();

            if (!availableOutputGroups.SelectMany(group => group.Items).Any())
            {
                return(selectedOutputItems);
            }

            using (var form = new FormPreview(
                       MainForm,
                       PowerPointProcessor))
            {
                form.LoadGroups(availableOutputGroups);
                if (form.ShowDialog() == DialogResult.OK)
                {
                    selectedOutputItems.AddRange(form.GetSelectedItems());
                }
            }

            return(selectedOutputItems);
        }