示例#1
0
        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);
            }
        }
示例#2
0
        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);
        }
示例#3
0
        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);
        }
示例#6
0
        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);
            }
        }
示例#7
0
        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);
            }
        }