private static string GetNotesFirstLine(SlideShowWindow slideShowWindow)
 {
     var slide = slideShowWindow.View.Slide;
     var result = slideShowWindow.View.Slide.HasNotesPage;
     if (result == MsoTriState.msoTrue)
     {
         var notes = slide.NotesPage;
         var shapes = notes.Shapes;
         foreach (Shape shape in shapes)
         {
             if (shape.Type == MsoShapeType.msoPlaceholder && shape.PlaceholderFormat.Type == PpPlaceholderType.ppPlaceholderBody)
             {
                 if (shape.HasTextFrame == MsoTriState.msoTrue)
                 {
                     TextFrame textFrame = shape.TextFrame;
                     if (textFrame.HasText == MsoTriState.msoTrue)
                     {
                         TextRange textRange = textFrame.TextRange;
                         string allText = textRange.Text;
                         string[] lines = allText.Split('\r');
                         string notesFirstLine = lines.FirstOrDefault();
                         return notesFirstLine;
                     }
                 }
             }
         }
     }
     return null;
 }
예제 #2
0
        public Presenter(Application app, SlideShowWindow win)
        {
            app_ = app;
            win_ = win;

            try
            {
                provider_ = new Nui.Provider();
            }
            catch (InvalidOperationException)
            {
                provider_ = null;

                if (MessageBox.Show(
                    "Kinect is not detected. Check the connection and device.\nWould you like to disable Kinect for the presentation?",
                    "Kynapsee", MessageBoxButton.YesNo, MessageBoxImage.Exclamation) == MessageBoxResult.Yes)
                {
                    win_.Presentation.SetKinectEnable(false);
                    return;
                }
                win_.View.Exit();
                return;
            }

            gestures_ = win.Presentation.GetNuiModel();

            provider_.GestureDone += GestureDone;
            app.SlideShowNextSlide += SlideShowNextSlide;

            LoadSlideGestures();
        }
예제 #3
0
        void Application_SlideShowBegin(SlideShowWindow Wn)
        {
            if (!paneModel_.Presentation.GetKinectEnable())
                return;

            presenter_ = new Presenter(Application, Wn);

            /*
            if (!pres_.Tags.Get("KY_KinectEnabled", false))
                return;
            ssw_ = Wn;

            LoadKinect();

            if (kinect_ == null)
            {
                if (MessageBox.Show("Kinect is not detected. Check the connection and device.\nWould you like to disable Kinect for the presentation?",
                    "Kynapsee", MessageBoxButton.YesNo, MessageBoxImage.Exclamation) == MessageBoxResult.Yes)
                {
                    pres_.Tags.Add("KY_KinectEnabled", false);
                }
                else
                {
                    Wn.View.Exit();
                }
            }
            else
            {

            }
            */
        }
 private void OnNextSlide(SlideShowWindow window)
 {
     if (_form != null && NotesChanged != null)
     {
         NotesChanged(this, new NotesChangedEventArgs(GetNotes(window.View.Slide)));
     }
 }
예제 #5
0
 private void Application_SlideShowBegin(SlideShowWindow Wn)
 {
     if (_overlay == null)
     {
         _overlay = new PresentationOverlay();
         _overlay.DataContext = new PresentationOverlayViewModel {SlideShowWindow = Wn};
         _overlay.Show();
     }
 }
        public void Start(SlideShowWindow slideShowWindow)
        {
            _slideShowWindow = slideShowWindow;

            _bodyFrameReader = _kinectSensor.BodyFrameSource.OpenReader();
            _bodyFrameReader.FrameArrived += OnBodyFrameArrived;

            _bodies.Clear();
            _scans.Clear();
        }
예제 #7
0
 //跳转,包括上一页下一页
 void Application_SlideShowNextSlide(SlideShowWindow Wn)
 {
     if (!Controller.isPlaying)
     {
         Controller.isPlaying = true;
         Controller.show = Wn;
     }
     if (isClientOnline)
         server.jumpTo(Wn.View.Slide.SlideIndex);
 }
 private void Application_SlideShowBegin(SlideShowWindow Wn)
 {
     if (Properties.Settings.Default.NDIStatic)
     {
         _window    = Wn;
         _ndiSender = new Thread(SendNdi)
         {
             Priority = ThreadPriority.Normal, Name = "StaticNdiSenderThread", IsBackground = true
         };
         _ndiSender.Start();
     }
 }
예제 #9
0
        //##################################################################################################### EVENEMENT DU SLIDESHOW

        /// <summary>
        /// Méthode déclenchée lorsque le slideshow/diaporama passe à la slide suivante
        /// </summary>
        /// <param name="Wn">La page du slideshow, soit le diaporama en cours. C'est dans cette classe qu'on peut changer manuellement de slide, etc...</param>
        private void Application_SlideShowNextSlide(SlideShowWindow Wn)
        {
            if (this.pointer != null)
            {
                this.deleteCurrentPointer();
            }

            if (this.ribbon.chkPointer.Checked)
            {
                this.createPointer(Wn.View.Slide);
            }
        }
예제 #10
0
        /// <summary>
        /// Called when a slide is loaded, in a slide show mode. Kills existing countdown, and start thoses on the
        /// loaded slide
        /// </summary>
        /// <param name="SlideShowWindow">The current slide show window</param>
        void OnSlideShowNextSlide(SlideShowWindow SlideShowWindow)
        {
            // If timers are running, kill them before starting them on the new slide
            disposeCountDowns();

            // If a timer is on the slide, init it!
            var currentSlide = SlideShowWindow.View.Slide;

            runningCountDowns = getCountDowns(currentSlide)
                                .Select(shape => new CountDown(shape))
                                .ToList();
        }
예제 #11
0
 public void Application_SlideShowNextSlide(SlideShowWindow Wn)
 {
     presence.Details = Wn.Presentation.Name;
     presence.State   = Shared.Shared.getString("presenting");
     presence.Assets.LargeImageKey = "present";
     presence.Party = new Party()
     {
         ID   = Secrets.CreateFriendlySecret(new Random()),
         Max  = Wn.Presentation.Slides.Count,
         Size = Wn.View.CurrentShowPosition
     };
     client.SetPresence(presence);
 }
예제 #12
0
 private void ApplicationOnSlideShowEnd(Presentation presentation)
 {
     /*
      *  It's possible that the last active slide show was not the slide show that ended.
      *  The first clause is true if the active slide show ended manually.
      *  The second clause is true if the active slide show ended by clicking through to the end.
      */
     if (!_application.SlideShowWindows.Cast <SlideShowWindow>().Contains(SlideShowWindow) ||
         SlideShowWindow.View.State == PpSlideShowState.ppSlideShowDone)
     {
         SlideShowWindow = null;
     }
 }
예제 #13
0
        //Slide moving in slide show
        void ThisAddIn_SlideShowNextSlide(SlideShowWindow Wn)
        {
            if (!this.expositionId.Equals(0))
            {
                //add a text box to each new slide
                PowerPoint.Shape textBox = Wn.View.Slide.Shapes.AddTextbox(
                    Office.MsoTextOrientation.msoTextOrientationHorizontal, 0, 0, 500, 50);
                textBox.TextFrame.TextRange.InsertAfter("Join us at: XXX/XXX");

                String slideId = Wn.View.Slide.SlideNumber.ToString();
                this.updateSlide(slideId);
            }
        }
예제 #14
0
        private void App_SlideShowNextSlide(SlideShowWindow Wn)
        {
            if (Wn != null)
            {
                Console.WriteLine($"Moved to Slide Number {Wn.View.Slide.SlideNumber}");
                //Text starts at Index 2 ¯\_(ツ)_/¯
                var note = String.Empty;
                try { note = Wn.View.Slide.NotesPage.Shapes[2].TextFrame.TextRange.Text; }
                catch { /*no notes*/ }

                ISceneManager reader = new PowerpointNotesSceneManager(_obsManager);
                reader.ProcessData(note);
            }
        }
예제 #15
0
 //Events
 public static void app_SlideShowNextSlide(SlideShowWindow Wn)
 {
     //System.Console.WriteLine(readSlideTimecode(Wn));
     //System.Console.WriteLine(readSlideText(Wn));
     StreamWriter sw = new StreamWriter(MainWindow.savePath, true);
     sw.WriteLine(GetTimestamp(DateTime.Now));
        // sw.WriteLine(readSlideTimecode(Wn));
     sw.WriteLine(readSlideText(Wn));
     sw.Close();
     addToInitialList(GetTimestamp(DateTime.Now), readSlideText(Wn));
     //addToList(readSlideText(Wn), readSlideTimecode(Wn));
     //crashing
        //addTimecodeToSlide(readSlide(Wn), readSlideTimecode(Wn));
 }
예제 #16
0
 /// <summary>
 /// Occures whenever a presentation starts
 /// </summary>
 /// <param name="window"></param>
 private void Event_BeginSlideShow(SlideShowWindow window)
 {
     //count = window.Presentation.Slides.Count;
     if (started == false)
     {
         started = true;
         Thread thread = new Thread(() => {
             Debug.WriteLine("Event: Begin Slide Show has occured");
             RestRequest request = new RestRequest("Broadcast/NetworkEvent_SlideShowStart");
             client.Post(request);
         });
         thread.Start();
     }
 }
예제 #17
0
        /*
         * Creates a new evaluation diagram and replaces the existing image.
         */
        private void createNewDiagram(Evaluation evaluation, SlideShowWindow ssw, Dictionary <String, int> newAnswers)
        {
            // delete answer diagram of current slide
            ssw.View.Slide.Shapes[ssw.View.Slide.Shapes.Count].Delete();

            // create a new bar chart
            Charting.Chart barChart = createBarChart(newAnswers);

            // replace old diagram image with new one
            barChart.SaveImage(evaluation.pathToDiagramImage, Charting.ChartImageFormat.Png);

            // add diagramm image to current slide
            ssw.View.Slide.Shapes.AddPicture2(evaluation.pathToDiagramImage, Microsoft.Office.Core.MsoTriState.msoTrue, Microsoft.Office.Core.MsoTriState.msoTrue, DiagramImageX, DiagramImageY);
        }
예제 #18
0
        public StageViewForm(SlideShowWindow wn)
        {
            SlideShowWindow = wn;
            InitializeComponent();
            refreshTimer          = new Timer();
            refreshTimer.Interval = TimerInterval;
            refreshTimer.Tick    += OnDisplayTick;
            refreshTimer.Start();

            deactivateTimer          = new Timer();
            deactivateTimer.Interval = DeactivateDelay;
            deactivateTimer.Tick    += OnDeactivateTimer;

            LayoutObjects();
        }
예제 #19
0
 public static void TweetSlideChange_SlideShowNextSlide(Application powerpointApplication, SlideShowWindow slideShowWindow)
 {
     try
     {
         string subject = ConfigManager.CurrentUserSpecific.PresentationSubject;
         string notesFirstLine = GetNotesFirstLine(slideShowWindow);
         if (String.IsNullOrEmpty(notesFirstLine))
             return;
         string tweet = String.Format("{0} {1}", subject, notesFirstLine).Trim();
         TwitterFeedSupport.Tweet(tweet);
     }
     catch
     {
     }
 }
예제 #20
0
        void IClickerTarget.SendPrevious()
        {
            try
            {
                SlideShowWindow w = GetActiveSlideShowWindow();

                if (w != null)
                {
                    w.View.Previous();
                }
            }
            catch (Exception)
            {
            }
        }
예제 #21
0
        public bool startSlideShow()
        {
            if (this.powerpoint == null)
            {
                return(false);
            }
            if (this.powerpoint.Presentations.Count == 0)
            {
                return(false);
            }

            stopSlideShow();
            if (slides == null)
            {
                presentations = powerpoint.Presentations;
                presentation  = presentations._Index(1);
                if (presentation != null)
                {
                    slides = presentation.Slides;
                }
            }
            if (slides != null)
            {
                int   all      = slides.Count;
                int[] SlideIdx = new int[all];
                for (int i = 0; i < all; i++)
                {
                    SlideIdx[i] = i + 1;
                }
                slideRange = slides.Range(SlideIdx);

                slideShowTransition = slideRange.SlideShowTransition;
                slideShowTransition.AdvanceOnTime = Microsoft.Office.Core.MsoTriState.msoFalse;
                slideShowTransition.EntryEffect   = Microsoft.Office.Interop.PowerPoint.PpEntryEffect.ppEffectBoxOut;

                //Prevent Office Assistant from displaying alert messages:
                //dumps if NotFiniteNumberException installed   bAssistantOn = powerpoint.Assistant.On;
                //   powerpoint.Assistant.On = false;
                //Run the Slide show
                slideShowSettings = presentation.SlideShowSettings;
                slideShowSettings.StartingSlide = 1;
                slideShowSettings.EndingSlide   = all;
                slideShowWindow  = slideShowSettings.Run();
                slideShowWindows = powerpoint.SlideShowWindows;
            }

            return(true);
        }
예제 #22
0
        void IClickerTarget.SendNext()
        {
            try
            {
                SlideShowWindow w = GetActiveSlideShowWindow();

                // Prevent click-through of "End of slide show, click to exit." placeholder screen
                if (w != null && w.View.State != PPt.Enums.PpSlideShowState.ppSlideShowDone)
                {
                    w.View.Next();
                }
            }
            catch (Exception)
            {
            }
        }
예제 #23
0
        void Application_SlideShowEnd(PowerPoint.Presentation Pres)
        {
            this.slideShow = null;

            //Si on souhaite que les transitions soient optimisé pour kinect via la checkbox du ruban
            if (this.ribbon.chkTransition.Checked == true)
            {
                //Récupère les transitions
                for (int i = 1; i <= this.Application.ActivePresentation.Slides.Count; i++)
                {
                    //Récupération de la slide
                    this.Application.ActivePresentation.Slides[i].SlideShowTransition.EntryEffect = transitionsBackup[i].EntryEffect;
                    this.Application.ActivePresentation.Slides[i].SlideShowTransition.Duration    = transitionsBackup[i].Duration;
                }
            }
        }
예제 #24
0
        /// <summary>
        /// Fires when a slideshow begins
        /// </summary>
        static void ppt_SlideShowBegin(SlideShowWindow win)
        {
            if (ActiveSlideShow != null)
            {
                Log.Warning("Ignoring new slide show as another is already active");
                return;
            }

            Log.Success("Beginning slide show");
            Log.Success("\t" + formatPresentationNameForConsole(win.Presentation));

            // Start the timer & store presentation references
            ActiveSlideShow      = win;
            ActiveSlideShowCache = new Cache(win.Presentation);
            watch.Reset();
            watch.Start();
        }
예제 #25
0
 /// <summary>
 /// Called each time a slide is loaded. Effect will tell if an effect is eligible on the next click,
 /// if so, mark the corresponding timer as "elligible" for start on the next click
 /// </summary>
 /// <param name="SlideShowWindow"></param>
 /// <param name="Effect"></param>
 void OnSlideShowNextClick(SlideShowWindow SlideShowWindow, Effect Effect)
 {
     // Detect which CountDown will start at next click
     if (Effect != null)
     {
         if (Effect.Shape.Tags[Constants.TimerLauncher] == Constants.TimerLauncherValue)
         {
             runningCountDowns
             .FirstOrDefault <CountDown>(cd => cd.UnderlyingLauncherShapeId == Effect.Shape.Id)?.Init();
         }
     }
     else
     {
         runningCountDowns.FirstOrDefault <CountDown>(cd => cd.Status == CountDownStatusEnum.Ready)
         ?.Start();
     }
 }
 async static void App_SlideShowNextSlide(SlideShowWindow Wn)
 {
     if (Wn != null)
     {
         Console.WriteLine($"Moved to Slide Number {Wn.View.Slide.SlideNumber}");
         //Text starts at Index 2 ¯\_(ツ)_/¯
         var note = String.Empty;
         try { note = Wn.View.Slide.NotesPage.Shapes[2].TextFrame.TextRange.Text; }
         catch { /*no notes*/ }
         if (note.StartsWith("OBS:"))
         {
             note = new StringReader(note).ReadLine().Substring(4);
             Console.WriteLine($"  Switching to OBS Scene named \"{note}\"");
             OBS.ChangeScene(note);
         }
     }
 }
예제 #27
0
 public void ExitPresentation()
 {
     if (ActiveSlideShow == null)
     {
         throw new InvalidOperationException();
     }
     try
     {
         Debug.Print("Exit presentation called.");
         ActiveSlideShow.View.Exit();
     }
     catch (COMException)
     {
         // Handles COMException with error code 0x80004005
         // object does not exist
         ActiveSlideShow = null;
     }
 }
예제 #28
0
        public static void OnNextSlide(SlideShowWindow Wn)
        {
            int currentSlide = Wn.View.CurrentShowPosition;

            if (Connection.CurrentRole == Role.Notconnected)
            {
                return;
            }
            else if (Connection.CurrentRole == Role.Host)
            {
                ServerController.OnPresentationNextSlide(currentSlide);
            }
            else
            {
                Connection.clientConnection.ClPresentationNextSlide(currentSlide);
            }
            Connection.CurrentPresentation.CurrentSlide = currentSlide;
        }
예제 #29
0
        /// <summary>
        /// Get the active PowerPoint slide show window object
        ///
        /// If there are multiple active slide shows, only the first slide show window object will be returned
        /// </summary>
        /// <returns>SlideShowWindow, or null if none</returns>
        private static SlideShowWindow GetActiveSlideShowWindow()
        {
            try
            {
                PPt.Application pptApplication = PPt.Application.GetActiveInstance();

                if (pptApplication == null)
                {
                    return(null);
                }

                SlideShowWindow w = (SlideShowWindow)pptApplication.SlideShowWindows.FirstOrDefault();

                return(w);
            }
            catch (Exception)
            {
                return(null);
            }
        }
예제 #30
0
        public InShowRecordingControl(RecorderTaskPane recorder)
            : this()
        {
            _slideShowWindow = this.GetCurrentPresentation().Presentation.SlideShowWindow;
            _startingSlide   = this.GetCurrentPresentation().Presentation.SlideShowSettings.StartingSlide;
            _recorder        = recorder;

            // get slide show window
            var slideShowWindow = new IntPtr(_slideShowWindow.HWND);

            Native.RECT rec;
            Native.GetWindowRect(new HandleRef(new object(), slideShowWindow), out rec);

            Left    = rec.Right / GraphicsUtil.GetDpiScale() - Width;
            Top     = rec.Bottom / GraphicsUtil.GetDpiScale() - Height;
            _status = ButtonStatus.Idle;

            // disable undo button by default, enable only when there has something to undo
            undoButton.IsEnabled = false;
        }
예제 #31
0
        private void Simple_SlideShowNextSlide(SlideShowWindow Wn)
        {
            Slide slide = Wn.View.Slide;

            if (ShapesUitls.IsExistedOfShape(slide, "questionType") && slide.Shapes["questionType"].TextFrame.TextRange.Text.Equals("4"))
            {
                MF.CommandButton sumbitButton = (MF.CommandButton)slide.Shapes["sumbitButton"].OLEFormat.Object;//发布按钮
                sumbitButton.Click           -= sumbitSimpleQuestion_Click;
                sumbitButton.Click           += sumbitSimpleQuestion_Click;
                sumbitButton.TakeFocusOnClick = false;
                sumbitButton.Enabled          = true;
                buttonClickCount = 1;

                MF.CommandButton answerButton = (MF.CommandButton)slide.Shapes["answerButton"].OLEFormat.Object;//答案按钮
                answerButton.Click           -= answerSimple_Click;
                answerButton.Click           += answerSimple_Click;
                answerButton.TakeFocusOnClick = false;
                answerButton.Enabled          = true;
            }
        }
예제 #32
0
 /// <summary>
 /// Occurs whenever a transition between slides is made either forwards or backwards.
 /// </summary>
 /// <param name="window"></param>
 private void Event_NextSlide(SlideShowWindow window)
 {
     //count = window.Presentation.Slides.Count;
     //int currentIndex = window.View.Slide.SlideIndex;
     //int prevIndex = currentIndex - 1;
     //int nextIndex = currentIndex + 1;
     //this.PreviousSlide = (currentIndex == 1) ? null : window.Presentation.Slides[prevIndex];
     //this.CurrentSlide = window.Presentation.Slides[currentIndex];
     //this.NextSlide = (currentIndex == count) ? null : window.Presentation.Slides[nextIndex];
     if (next_slide_mutex == false)
     {
         next_slide_mutex = true;
         Thread thread = new Thread(() => {
             Debug.WriteLine("Event: Next Slide Show has occured");
             RestRequest request = new RestRequest("Broadcast/NetworkEvent_SlideChange");
             client.Post(request);
             next_slide_mutex = false;
         });
         thread.Start();
     }
 }
        private void OnSlideChange(SlideShowWindow slideShowWindow)
        {
            // TODO check if timer is running and cancel next or previous event!

            // start arsnova click question when getting on results slide
            var isSlideStartArsnovaClickQuestion = SlideTracker.IsPresentationOnStartArsnovaSlide();

            if (isSlideStartArsnovaClickQuestion.Item1)
            {
                this.ribbonHelper.StartQuiz(isSlideStartArsnovaClickQuestion.Item2);
                return;
            }

            var isSlideArsnovaVotingResultsSlide = SlideTracker.IsPresentationOnResultsArsnovaVotingSlide();

            if (isSlideArsnovaVotingResultsSlide.Item1)
            {
                //GetResults
                this.ribbonHelper.GetAndDisplayArsnovaVotingResults(isSlideArsnovaVotingResultsSlide.Item2);
            }
        }
예제 #34
0
        async static void App_SlideShowNextSlide(SlideShowWindow Wn)
        {
            if (Wn != null)
            {
                Console.WriteLine($"Moved to Slide Number {Wn.View.Slide.SlideNumber}");
                //Text starts at Index 2 ¯\_(ツ)_/¯
                var note = String.Empty;
                try { note = Wn.View.Slide.NotesPage.Shapes[2].TextFrame.TextRange.Text; }
                catch { /*no notes*/ }

                var    notereader = new StringReader(note);
                string line;
                while ((line = notereader.ReadLine()) != null)
                {
                    if (line.StartsWith("OBS:"))
                    {
                        line = line.Substring(4).Trim();
                        await HandleCommand(line);
                    }
                }
            }
        }
예제 #35
0
        private void Vote_SlideShowNextSlide(SlideShowWindow Wn)
        {
            Slide slide = Wn.View.Slide;

            if (ShapesUitls.IsExistedOfShape(slide, "questionType") && slide.Shapes["questionType"].TextFrame.TextRange.Text.Equals("5"))
            {
                MF.CommandButton sumbitButton = (MF.CommandButton)slide.Shapes["sumbitButton"].OLEFormat.Object;
                sumbitButton.Click           -= sumbitVote_Click;
                sumbitButton.Click           += sumbitVote_Click;
                sumbitButton.TakeFocusOnClick = false;
                sumbitButton.Enabled          = true;
                buttonClickCount = 1;

                //MF.CommandButton answerButton = (MF.CommandButton)slide.Shapes["answerButton"].OLEFormat.Object;
                //answerButton.Click -= answerSingleChocie_Click;
                //answerButton.Click += answerSingleChocie_Click;
                //answerButton.TakeFocusOnClick = false;
                //answerButton.Enabled = true;

                ShapesUitls.ChoiceOptionNoChecked(slide);
            }
        }
예제 #36
0
        public Controller(SlideShowWindow window)
        {
            view        = window.View;
            this.window = window;
            window.Application.SlideShowOnPrevious += (s) => SlideShowChanged?.Invoke(this, s);
            window.Application.SlideShowNextSlide  += (s) => SlideShowChanged?.Invoke(this, s);

            var    pageWidth  = window.Application.ActivePresentation.PageSetup.SlideWidth;
            var    pageHeight = window.Application.ActivePresentation.PageSetup.SlideHeight;
            var    screenSize = Screen.PrimaryScreen.Bounds;
            double rateWidth  = screenSize.Width / pageWidth;
            double rateHeight = screenSize.Height / pageHeight;

            if (rateWidth < rateHeight)
            {
                SlideShowMargin = new Size(0, (int)(screenSize.Height - pageHeight * rateWidth) / 2);
            }
            else
            {
                SlideShowMargin = new Size((int)(screenSize.Width - pageWidth * rateHeight) / 2, 0);
            }
        }
        private void Powerpoint_SlideShowNextSlide(SlideShowWindow Wn)
        {
            // extract title
            string title = "";

            //if (Wn.View.Slide.Shapes.HasTitle == Microsoft.Office.Core.MsoTriState.msoTrue)
            //{
            //    if (Wn.View.Slide.Shapes.Title.HasTextFrame == Microsoft.Office.Core.MsoTriState.msoTrue)
            //    {
            //        if (Wn.View.Slide.Shapes.Title.TextFrame.HasText == Microsoft.Office.Core.MsoTriState.msoTrue)
            //        {
            //            title = Wn.View.Slide.Shapes.Title.TextFrame.TextRange.Text;
            //        }
            //    }
            //}

            //string keywords = "";

            //foreach (Shape shape in Wn.View.Slide.Shapes)
            //{
            //    if (shape.HasTextFrame == Microsoft.Office.Core.MsoTriState.msoTrue)
            //    {
            //        if (shape.TextFrame.HasText == Microsoft.Office.Core.MsoTriState.msoTrue)
            //        {
            //            keywords += " " + shape.TextFrame.TextRange.Text;
            //        }
            //    }
            //}

            //keywords = keywords.Replace("\r\n", "");
            //keywords = keywords.Trim();

            SlideChanged(this, new SlideChangedEventArgs()
            {
                Title = title
            });
        }
예제 #38
0
        /*
         * What happens when next slide appears.
         */
        public void slideShowNextSlide(SlideShowWindow ssw)
        {
            if (startFromCurrentSlide)
            {
                startFromCurrentSlide = false;
                ssw.View.GotoSlide(slideIndexToStart);
            }

            onSlideTime = DateTime.Now;

            // cancel update thread when entering a new slide
            updateThread.Dispose();

            int currentSlideId    = ssw.View.Slide.SlideID;
            int currentSlideIndex = ssw.View.Slide.SlideIndex;

            // check if we are currently on a evaluation slide -> the forloop is a workaround
            foreach (var evaluationSlide in EvaluationSlides)
            {
                if (evaluationSlide.Key.SlideID == currentSlideId)
                {
                    var evaluation = EvaluationSlides[evaluationSlide.Key];
                    startUpdateThread(evaluation, ssw);
                    //updateSlide(null, null, evaluation, ssw);
                }
            }

            if (SlideIdPresentation != currentSlideId && MyRibbon.pptNavigator.getCustomSlideById(currentSlideId) != null)
            {
                //pushAndEvaluateThread(null, null, currentSlideId);
                startObserveTimer(currentSlideId);
            }

            // update slideId and slideIndex of current presentation
            SlideIndexPresentation = currentSlideIndex;
            SlideIdPresentation    = currentSlideId;
        }
예제 #39
0
        public InShowControl(RecorderTaskPane recorder)
        {
            InitializeComponent();

            // set the background transparency
            BackColor       = Color.Magenta;
            TransparencyKey = Color.Magenta;

            _slideShowWindow = PowerPointPresentation.Current.Presentation.SlideShowWindow;
            _startingSlide   = PowerPointPresentation.Current.Presentation.SlideShowSettings.StartingSlide;
            _recorder        = recorder;

            // get slide show window
            var slideShowWindow = new IntPtr(_slideShowWindow.HWND);

            Native.RECT rec;
            Native.GetWindowRect(new HandleRef(new object(), slideShowWindow), out rec);

            Location = new Point(rec.Right - Width, rec.Bottom - Height - 65);
            _status  = ButtonStatus.Idle;

            // disable undo button by default, enable only when there has something to undo
            undoButton.Enabled = false;
        }
        private void OnSlideShowBegin(SlideShowWindow Wn)
        {
            try
            {
                foreach (ISlideShowCommandDetector detector in detectors)
                {
                    detector.Initialize();
                }

                foreach (ISlideShowCommandDetector detector in detectors)
                {
                    detector.SlideShowCommandDetected += OnSlideShowCommandDetected;
                    detector.Start();
                }
            }
            catch
            {
                ErrorHandler.ShowSlideShowModeKinectNotFoundDialog();
            }

            slideShowView = Wn.View;
            slideId = slideShowView.Slide.SlideID;
            step = 0;
        }
예제 #41
0
        public InShowControl(RecorderTaskPane recorder)
        {
            InitializeComponent();
            
            // set the background transparency
            BackColor = Color.Magenta;
            TransparencyKey = Color.Magenta;

            _slideShowWindow = PowerPointPresentation.Current.Presentation.SlideShowWindow;
            _startingSlide = PowerPointPresentation.Current.Presentation.SlideShowSettings.StartingSlide;
            _recorder = recorder;

            // get slide show window
            var slideShowWindow = new IntPtr(_slideShowWindow.HWND);
            
            Native.RECT rec;
            Native.GetWindowRect(new HandleRef(new object(), slideShowWindow), out rec);
            
            Location = new Point(rec.Right - Width, rec.Bottom - Height- 65);
            _status = ButtonStatus.Idle;

            // disable undo button by default, enable only when there has something to undo
            undoButton.Enabled = false;
        }
예제 #42
0
        public bool startSlideShow()
        {
            if (this.powerpoint == null) return false;
              if (this.powerpoint.Presentations.Count == 0) return false;

              stopSlideShow();
              if (slides == null)
              {
              presentations = powerpoint.Presentations;
              presentation = presentations._Index(1);
              if (presentation != null)
              {
              slides = presentation.Slides;
              }
              }
              if (slides != null)
              {

              int all = slides.Count;
              int[] SlideIdx = new int[all];
              for (int i = 0; i < all; i++) SlideIdx[i] = i + 1;
              slideRange = slides.Range(SlideIdx);

              slideShowTransition = slideRange.SlideShowTransition;
              slideShowTransition.AdvanceOnTime = Microsoft.Office.Core.MsoTriState.msoFalse;
              slideShowTransition.EntryEffect = Microsoft.Office.Interop.PowerPoint.PpEntryEffect.ppEffectBoxOut;

              //Prevent Office Assistant from displaying alert messages:
              //dumps if NotFiniteNumberException installed   bAssistantOn = powerpoint.Assistant.On;
              //   powerpoint.Assistant.On = false;
              //Run the Slide show
              slideShowSettings = presentation.SlideShowSettings;
              slideShowSettings.StartingSlide = 1;
              slideShowSettings.EndingSlide = all;
              slideShowWindow = slideShowSettings.Run();
              slideShowWindows = powerpoint.SlideShowWindows;
              }

              return true;
        }
예제 #43
0
 public void slideShowStopped(Presentation presentation)
 {
     this.slideShowWindow = null;
       OfficeConsole.The.sendEvent("PowerPoint.SlideShowEndEvent " + presentation.Name);
 }
예제 #44
0
 // ------------------- Event handlers -----------------------
 public void slideShowStarted(SlideShowWindow window)
 {
     this.slideShowWindow = window;
       OfficeConsole.The.sendEvent("PowerPoint.SlideShowBeginEvent " + window.Presentation.Name);
 }
예제 #45
0
 void slideShowOnPrevious(SlideShowWindow Wn)
 {
     ThisAddIn.The.sendStringMessage("PowerPoint.SlideShowOnPreviousEvent " + CurrentSlide);
 }
 private void OnSlideShowBegin(SlideShowWindow window)
 {
     _win = window;
     if(_form != null)
     {
         _form.Show();
     }
 }
예제 #47
0
 void slideShowNextSlide(SlideShowWindow Wn)
 {
     ThisAddIn.The.sendStringMessage("PowerPoint.SlideShowNextSlideEvent " + CurrentSlide);
 }
예제 #48
0
 void slideShowOnNext(SlideShowWindow Wn)
 {
     OfficeConsole.The.sendEvent("PowerPoint.SlideShowOnNextEvent " + CurrentSlide);
 }
 private void OnSlideShowNextSlide(SlideShowWindow Wn)
 {
     slideId = slideShowView.Slide.SlideID;
     step = 0;
 }
예제 #50
0
 public static Slide readSlide(SlideShowWindow Wn)
 {
     //SlideShowView ssv  = oPre.SlideShowWindow.View;
     SlideShowView ssv = Wn.View;
     return ssv.Slide;
 }
예제 #51
0
 public static float readSlideTimecode(SlideShowWindow Wn)
 {
     String timeStamp = GetTimestamp(DateTime.Now);
     float timecode = Wn.View.SlideElapsedTime;
     return timecode;
 }
예제 #52
0
 public static void app_SlideShowBegin(SlideShowWindow Wn)
 {
     System.Console.WriteLine("Slide Show begins");
 }
 private void OnSlideShowEnd(Presentation presentation)
 {
     _win = null;
     if (_form != null)
     {
         _form.Hide();
     }
 }
예제 #54
0
        public bool stopSlideShow()
        {
            if (this.powerpoint == null) return false;
              if (this.powerpoint.Presentations.Count == 0) return false;

              if (slideShowWindow != null)
              {
            slideShowWindow.View.Exit();
            slideShowWindow = null;
            return true;
              }
              else
            return false;
        }
예제 #55
0
 void slideShowNextClick(SlideShowWindow Wn, Effect nEffect)
 {
     OfficeConsole.The.sendEvent("PowerPoint.SlideShowNextClickEvent " + CurrentSlide);
 }
예제 #56
0
		void m_PowerPointApplication_SlideShowBegin (SlideShowWindow Wn)
			{
			try
				{
				Wn.Left = (int) ((double) m_HostCVM.XPosition * WMB.Basics.XDPIFactor);
				Wn.Top = (int) ((double) m_HostCVM.YPosition * WMB.Basics.YDPIFactor);
				Wn.Width = (int) ((double) m_HostCVM.VideoWidth * WMB.Basics.XDPIFactor);
				Wn.Height = (int) ((double) m_HostCVM.VideoHeight * WMB.Basics.YDPIFactor);
				}
			catch (Exception Excp)
				{
				WMB.Basics.ReportErrorToEventViewer (m_MessageDescriptionID + ".m_PowerPointApplication_SlideShowBegin",
					"Es trat folgender Fehler auf:\r\n" + Excp.ToString());
				
				}
			}
예제 #57
0
 void slideShowOnPrevious(SlideShowWindow Wn)
 {
     OfficeConsole.The.sendEvent("PowerPoint.SlideShowOnPreviousEvent " + CurrentSlide);
 }
예제 #58
0
        void Application_SlideShowNextSlide(SlideShowWindow Wn)
        {
            /*
            if (kinect_ == null)
                return;

            if (trackedShapes_.Count > 0)
                kinect_.Nui.SkeletonFrameReady -= Nui_SkeletonFrameReady;
            bool hasTrackedShape = false;
            trackedShapes_.Clear();
            foreach (Shape shape in Wn.View.Slide.Shapes)
            {
                if (shape.Tags["KY_Joint"] != "")
                {
                    trackedShapes_[shape.Tags["KY_Joint"] == "LeftHand" ? JointID.HandLeft : JointID.HandRight] = shape;
                    hasTrackedShape = true;
                }
            }
            if (hasTrackedShape)
                kinect_.Nui.SkeletonFrameReady += Nui_SkeletonFrameReady;
            */
        }
예제 #59
0
 public static String readSlideText(SlideShowWindow Wn)
 {
     SlideShowView ssv = Wn.View;
     Slide currentSlide = ssv.Slide;
     if (currentSlide.Shapes.Count==0)
     {
         System.Console.WriteLine("Error");
         return "";
     }
     else {
         TextRange tr = currentSlide.Shapes[1].TextFrame.TextRange;
         return italicFilter(tr);
     }
 }
 public void ShowSlidePresentation()
 {
     window = presentation.SlideShowSettings.Run();
 }