public override void OutputPdf()
        {
            var outputItems = GetOutputItems(false);

            if (!outputItems.Any())
            {
                return;
            }

            FormProgress.SetTitle("Chill-Out for a few seconds...\nGenerating slides so your presentation can look AWESOME!");
            FormProgress.ShowOutputProgress();
            Controller.Instance.ShowFloater(() =>
            {
                var pdfFileName = Path.Combine(
                    Environment.GetFolderPath(Environment.SpecialFolder.Desktop),
                    String.Format("{0}-{1:MM-dd-yy-hmmss}.pdf", "star", DateTime.Now));
                BusinessObjects.Instance.PowerPointManager.Processor.BuildPdf(pdfFileName, presentation =>
                {
                    foreach (var outputItem in outputItems)
                    {
                        outputItem.SlideGeneratingAction?.Invoke(BusinessObjects.Instance.PowerPointManager.Processor, presentation);
                    }
                });
                FormProgress.CloseProgress();
                if (File.Exists(pdfFileName))
                {
                    try
                    {
                        Process.Start(pdfFileName);
                    }
                    catch { }
                }
            });
        }
        private bool HandleVideoDownloaded(string filePath)
        {
            _siteContainer.ParentBundle.PowerPointSingleton.Connect();
            var activePresentation = _siteContainer.ParentBundle.PowerPointSingleton.GetActivePresentation();
            var allowVideoInsert   = activePresentation != null && File.Exists(activePresentation.FullName);

            if (allowVideoInsert)
            {
                using (var formComplete = new FormVideoDownloadComplete(filePath))
                {
                    var result = formComplete.ShowDialog(_siteContainer.ParentBundle.MainForm);
                    if (result == DialogResult.Abort)
                    {
                        _siteContainer.ParentBundle.ShowFloater(new FloaterRequestedEventArgs
                        {
                            AfterShow = () =>
                            {
                                FormProgress.SetTitle("Chill-Out for a few seconds...\nGenerating slides so your presentation can look AWESOME!");
                                FormProgress.ShowOutputProgress();
                                _siteContainer.ParentBundle.PowerPointSingleton.InsertVideoIntoActivePresentation(filePath);
                                FormProgress.CloseProgress();
                            }
                        });
                    }
                    return(true);
                }
            }
            return(false);
        }
コード例 #3
0
        protected override void OutputPdfSlides(IList <OutputItem> outputItems)
        {
            FormProgress.SetTitle(outputItems.Count == 2 ? "Creating 2 (two) Calendar slides…\nThis will take about a minute…" : "Creating Calendar slides…\nThis will take a few minutes…");
            FormProgress.ShowOutputProgress();
            Controller.Instance.ShowFloater(() =>
            {
                Enabled = false;

                var pdfFileName = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), String.Format("{0}-{1:MM-dd-yy-hmmss}.pdf", Schedule.Name, DateTime.Now));
                PowerPointProcessor.BuildPdf(pdfFileName, presentation =>
                {
                    foreach (var outputItem in outputItems)
                    {
                        outputItem.SlideGeneratingAction?.Invoke(PowerPointProcessor, presentation);
                    }
                });
                if (File.Exists(pdfFileName))
                {
                    try
                    {
                        Process.Start(pdfFileName);
                    }
                    catch { }
                }

                Enabled = true;
                FormProgress.CloseProgress();
            });
        }
コード例 #4
0
        private void GenerateOutput(SlideMaster slideMaster)
        {
            if (!AppManager.Instance.CheckPowerPointRunning())
            {
                return;
            }

            var outputItems = GetOutputItems(slideMaster);

            if (!outputItems.Any())
            {
                return;
            }

            FormProgress.SetTitle("Chill-Out for a few seconds...\nGenerating slides so your presentation can look AWESOME!");
            FormProgress.ShowOutputProgress();
            AppManager.Instance.ShowFloater(() =>
            {
                foreach (var outputItem in outputItems)
                {
                    outputItem.SlideGeneratingAction?.Invoke(AppManager.Instance.PowerPointManager.Processor, null);
                }
                FormProgress.CloseProgress();
            });
        }
コード例 #5
0
 public override void OutputPowerPointCustom(IList <OutputItem> outputItems)
 {
     if (!outputItems.Any())
     {
         return;
     }
     FormProgress.SetTitle("Chill-Out for a few seconds...\nGenerating slides so your presentation can look AWESOME!");
     FormProgress.ShowOutputProgress();
     Controller.Instance.ShowFloater(() =>
     {
         outputItems.ForEach(item => item.SlideGeneratingAction?.Invoke(BusinessObjects.Instance.PowerPointManager.Processor, null));
         FormProgress.CloseProgress();
     });
 }
コード例 #6
0
        protected override void OutpuPowerPointSlides(IList <OutputItem> outputItems)
        {
            FormProgress.SetTitle(outputItems.Count == 2 ? "Creating 2 (two) Calendar slides…\nThis will take about a minute…" : "Creating Calendar slides…\nThis will take a few minutes…");
            FormProgress.ShowOutputProgress();
            Controller.Instance.ShowFloater(() =>
            {
                Enabled = false;

                foreach (var outputItem in outputItems)
                {
                    outputItem.SlideGeneratingAction?.Invoke(PowerPointProcessor, null);
                }

                Enabled = true;
                FormProgress.CloseProgress();
            });
        }
コード例 #7
0
        public void OutputPowerPoint(SlideMaster slideMaster = null)
        {
            var outputItems = GetOutputItems(slideMaster);

            if (!outputItems.Any())
            {
                return;
            }

            FormProgress.SetTitle("Chill-Out for a few seconds...\nGenerating slides so your presentation can look AWESOME!");
            FormProgress.ShowOutputProgress();
            Controller.Instance.ShowFloater(() =>
            {
                foreach (var outputItem in outputItems)
                {
                    outputItem.SlideGeneratingAction?.Invoke(BusinessObjects.Instance.PowerPointManager.Processor, null);
                }
                FormProgress.CloseProgress();
            });
        }
        private void OnSlideContentWebViewDownloadCompleted(object sender, DownloadEventArgs e)
        {
            if (!_extensionsManager.LinkViewContentExtension.ContentEnabled)
            {
                return;
            }
            switch (_afterDownloadAction)
            {
            case AfterDownloadAction.Print:
                ExtensionsManager.PrintFile(
                    e.Item.FullPath,
                    (_extensionsManager.LinkViewContentExtension.CurrentPrintableContent.CurrentPage + 1) ?? 1);
                break;

            default:
                _siteContainer.ParentBundle.ShowFloater(new FloaterRequestedEventArgs
                {
                    AfterShow = () =>
                    {
                        if (_extensionsManager.LinkViewContentExtension.CurrentLinkViewContent?.ContentType == LinkContentType.Video)
                        {
                            FormProgress.SetTitle("Chill-Out for a few seconds...\nGenerating slides so your presentation can look AWESOME!");
                            FormProgress.ShowOutputProgress();
                            _siteContainer.ParentBundle.PowerPointSingleton.InsertVideoIntoActivePresentation(e.Item.FullPath);
                            FormProgress.CloseProgress();
                        }
                        else if (_extensionsManager.LinkViewContentExtension.CurrentLinkViewContent?.ContentType == LinkContentType.PowerPoint)
                        {
                            FormProgress.SetTitle("Chill-Out for a few seconds...\nGenerating slides so your presentation can look AWESOME!");
                            FormProgress.ShowOutputProgress();
                            _siteContainer.ParentBundle.PowerPointSingleton.AppendSlidesFromFile(e.Item.FullPath);
                            FormProgress.CloseProgress();
                        }
                    }
                });
                break;
            }
        }