protected override void ExecuteAction(string ribbonId) { this.StartNewUndoEntry(); PowerPointSlide currentSlide = this.GetCurrentSlide(); Selection selection = this.GetCurrentSelection(); if (currentSlide == null || !ShapeUtil.IsSelectionShape(selection)) { return; } try { bool success = ConvertToTooltip.AddTriggerAnimation(currentSlide, selection); if (success) { // Open the animation custom pane if it is not opened if (!this.GetApplication().CommandBars.GetPressedMso("AnimationCustom")) { this.GetApplication().CommandBars.ExecuteMso("AnimationCustom"); } } } catch (Exception e) { ErrorDialogBox.ShowDialog("PowerPointLabs", e.Message, e); } }
private void CreateTooltipOnSlide(int slideNo) { PowerPointSlide currentSlide = PowerPointSlide.FromSlideFactory(PpOperations.GetCurrentSlide()); Shape triggerShape = PowerPointLabs.TooltipsLab.CreateTooltip.GenerateTriggerShape(currentSlide); Shape callout = PowerPointLabs.TooltipsLab.CreateTooltip.GenerateCalloutWithReferenceTriggerShape(currentSlide, triggerShape); ConvertToTooltip.AddTriggerAnimation(currentSlide, triggerShape, callout); }
private void CreateCalloutAndCompare(Shape selectedShape, int testSlideNo, int expectedSlideNo) { PowerPointSlide currentSlide = PowerPointSlide.FromSlideFactory(PpOperations.GetCurrentSlide()); Shape callout = CreateTooltip.GenerateCalloutWithReferenceTriggerShape(currentSlide, selectedShape); ConvertToTooltip.AddTriggerAnimation(currentSlide, selectedShape, callout); AssertIsSame(testSlideNo, expectedSlideNo); }
private void CreateMultipleTriggerAndCompare(ShapeRange selectedShapes, int testSlideNo, int expectedSlideNo) { PowerPointSlide currentSlide = PowerPointSlide.FromSlideFactory(PpOperations.GetCurrentSlide()); foreach (Shape shape in selectedShapes) { Shape triggerShape = CreateTooltip.GenerateTriggerShapeWithReferenceCallout(currentSlide, shape); ConvertToTooltip.AddTriggerAnimation(currentSlide, triggerShape, shape); } AssertIsSame(testSlideNo, expectedSlideNo); }
private void ConvertShapesToTooltipAndCompare(string[] shapeNames, int testSlideNo, int expectedSlideNo, bool isSuccessful) { Slide slide = PpOperations.SelectSlide(testSlideNo); PowerPointSlide currentSlide = PowerPointSlide.FromSlideFactory(slide); ShapeRange selectedShapes = PpOperations.SelectShapes(shapeNames); if (isSuccessful) { Assert.AreEqual(ConvertToTooltip.AddTriggerAnimation(currentSlide, selectedShapes), isSuccessful); } else { MessageBoxUtil.ExpectMessageBoxWillPopUp( TooltipsLabText.ErrorTooltipsDialogTitle, TooltipsLabText.ErrorLessThanTwoShapesSelected, () => { ConvertToTooltip.AddTriggerAnimation(currentSlide, selectedShapes); }); } AssertIsSame(testSlideNo, expectedSlideNo); }
protected override void ExecuteAction(string ribbonId) { this.StartNewUndoEntry(); PowerPointSlide currentSlide = this.GetCurrentSlide(); if (currentSlide == null) { return; } PowerPoint.Shape triggerShape = CreateTooltip.GenerateTriggerShape(currentSlide); PowerPoint.Shape callout = CreateTooltip.GenerateCalloutWithReferenceTriggerShape(currentSlide, triggerShape); ConvertToTooltip.AddTriggerAnimation(currentSlide, triggerShape, callout); if (!this.GetApplication().CommandBars.GetPressedMso(TooltipsLabConstants.AnimationPaneName)) { this.GetApplication().CommandBars.ExecuteMso(TooltipsLabConstants.AnimationPaneName); } }
protected override void ExecuteAction(string ribbonId) { this.StartNewUndoEntry(); PowerPointSlide currentSlide = this.GetCurrentSlide(); Selection selection = this.GetCurrentSelection(); if (currentSlide == null || !ShapeUtil.IsSelectionShape(selection)) { return; } foreach (PowerPoint.Shape selectedShape in selection.ShapeRange) { PowerPoint.Shape triggerShape = CreateTooltip.GenerateTriggerShapeWithReferenceCallout(currentSlide, selectedShape); ConvertToTooltip.AddTriggerAnimation(currentSlide, triggerShape, selectedShape); } if (!this.GetApplication().CommandBars.GetPressedMso(TooltipsLabConstants.AnimationPaneName)) { this.GetApplication().CommandBars.ExecuteMso(TooltipsLabConstants.AnimationPaneName); } }