コード例 #1
0
 public static ISlideshowPresentation CreatePresentation(SlideshowMedia media)
 {
     switch (media.Target)
     {
         case SlideshowPresentationTarget.Impress:
             var impressPres = (ISlideshowPresentation)Controller.PresentationManager.CreatePresentation(impressPresentationType);
             impressPresentationType.GetMethod("Init", new Type[] { typeof(FileInfo) }).Invoke(impressPres, new object[] { new FileInfo(media.Uri.LocalPath) });
             return impressPres;
         case SlideshowPresentationTarget.PowerpointViewer:
             var pptViewPres = Controller.PresentationManager.CreatePresentation<PowerpointViewerPresentation>();
             pptViewPres.File = new FileInfo(media.Uri.LocalPath);
             return pptViewPres;
         case SlideshowPresentationTarget.Powerpoint:
             var powerpointPres = (ISlideshowPresentation)Controller.PresentationManager.CreatePresentation(powerpointPresentationType);
             powerpointPresentationType.GetMethod("Init", new Type[] { typeof(FileInfo) }).Invoke(powerpointPres, new object[] { new FileInfo(media.Uri.LocalPath) });
             return powerpointPres;
         default:
             throw new InvalidOperationException("Invalid Slideshow Presentation Target");
     }
 }
コード例 #2
0
        public static ISlideshowPresentation CreatePresentation(SlideshowMedia media)
        {
            switch (media.Target)
            {
            case SlideshowPresentationTarget.Impress:
                var impressPres = (ISlideshowPresentation)Controller.PresentationManager.CreatePresentation(impressPresentationType);
                impressPresentationType.GetMethod("Init", new Type[] { typeof(FileInfo) }).Invoke(impressPres, new object[] { new FileInfo(media.Uri.LocalPath) });
                return(impressPres);

            case SlideshowPresentationTarget.PowerpointViewer:
                var pptViewPres = Controller.PresentationManager.CreatePresentation <PowerpointViewerPresentation>();
                pptViewPres.File = new FileInfo(media.Uri.LocalPath);
                return(pptViewPres);

            case SlideshowPresentationTarget.Powerpoint:
                var powerpointPres = (ISlideshowPresentation)Controller.PresentationManager.CreatePresentation(powerpointPresentationType);
                powerpointPresentationType.GetMethod("Init", new Type[] { typeof(FileInfo) }).Invoke(powerpointPres, new object[] { new FileInfo(media.Uri.LocalPath) });
                return(powerpointPres);

            default:
                throw new InvalidOperationException("Invalid Slideshow Presentation Target");
            }
        }