public TooltipsLabSettingsDialogBox(MsoAutoShapeType selectedShapeType, MsoAnimEffect selectedAnimType)
 {
     lastSelectedShapeType = selectedShapeType;
     lastSelectedAnimType  = selectedAnimType;
     InitializeComponent();
     Initialize();
 }
Ejemplo n.º 2
0
        public Effect AddShapeAsLastAutoplaying(Shape shape, MsoAnimEffect effect)
        {
            Effect addedEffect = _slide.TimeLine.MainSequence.AddEffect(shape, effect,
                                                                        MsoAnimateByLevel.msoAnimateLevelNone, MsoAnimTriggerType.msoAnimTriggerWithPrevious);

            return(addedEffect);
        }
Ejemplo n.º 3
0
        public Effect SetShapeAsClickTriggered(Shape shape, int clickNumber, MsoAnimEffect effect)
        {
            Effect addedEffect;

            Sequence mainSequence        = _slide.TimeLine.MainSequence;
            Effect   nextClickEffect     = mainSequence.FindFirstAnimationForClick(clickNumber + 1);
            Effect   previousClickEffect = mainSequence.FindFirstAnimationForClick(clickNumber);

            bool hasClicksAfter = nextClickEffect != null;
            bool hasClickBefore = previousClickEffect != null;

            if (hasClicksAfter)
            {
                addedEffect = InsertAnimationBeforeExisting(shape, nextClickEffect, effect);
            }
            else if (hasClickBefore)
            {
                addedEffect = AddShapeAsLastAutoplaying(shape, effect);
            }
            else
            {
                addedEffect = mainSequence.AddEffect(shape, effect);
            }

            return(addedEffect);
        }
Ejemplo n.º 4
0
        private Effect InsertAnimationAtIndex(Shape shape, int index, MsoAnimEffect animationEffect,
                                              MsoAnimTriggerType triggerType)
        {
            var    animationSequence = _slide.TimeLine.MainSequence;
            Effect effect            = animationSequence.AddEffect(shape, animationEffect, MsoAnimateByLevel.msoAnimateLevelNone,
                                                                   triggerType);

            effect.MoveTo(index);
            return(effect);
        }
 public TooltipsLabSettingsAnimationEntry(MsoAnimEffect defaultEffectType, Bitmap image)
 {
     InitializeComponent();
     Type            = defaultEffectType;
     imageBox.Source = Imaging.CreateBitmapSourceFromHBitmap(
         image.GetHbitmap(),
         IntPtr.Zero,
         Int32Rect.Empty,
         BitmapSizeOptions.FromWidthAndHeight(50, 50));
 }
Ejemplo n.º 6
0
        /// <summary>
        /// Append animation for `shape` with effect type `effectType` to `slide`
        /// </summary>
        /// <param name="slide"></param>
        /// <param name="shape"></param>
        /// <param name="effectType">specifies the type for the generated animation effect</param>
        /// <param name="clickNo">the clickNo in which the specified effect should appear</param>
        /// <returns></returns>
        public static Effect AppendAnimationToSlide(PowerPointSlide slide, Shape shape,
                                                    MsoAnimEffect effectType, int clickNo)
        {
            Effect effect = slide.SetShapeAsClickTriggered(shape, clickNo, effectType);

            if (StringUtility.ExtractFunctionFromString(shape.Name).Equals(ELearningLabText.CalloutIdentifier))
            {
                effect.EffectType = MsoAnimEffect.msoAnimEffectFade;
            }
            return(effect);
        }
Ejemplo n.º 7
0
        private Effect InsertAnimationBeforeExisting(Shape shape, Effect existing, MsoAnimEffect effect)
        {
            var sequence = _slide.TimeLine.MainSequence;

            Effect newAnimation = sequence.AddEffect(shape, effect, MsoAnimateByLevel.msoAnimateLevelNone,
                                                     MsoAnimTriggerType.msoAnimTriggerWithPrevious);

            newAnimation.MoveBefore(existing);

            return(newAnimation);
        }
 public TooltipsLabSettingsAnimationEntry(MsoAnimEffect defaultEffectType, Bitmap image)
 {
     InitializeComponent();
     Type            = defaultEffectType;
     imageBox.Source = GraphicsUtil.BitmapToImageSource(image);
 }
        public Effect SetShapeAsClickTriggered(Shape shape, int clickNumber, MsoAnimEffect effect)
        {
            Effect addedEffect;

            Sequence mainSequence = _slide.TimeLine.MainSequence;
            Effect nextClickEffect = mainSequence.FindFirstAnimationForClick(clickNumber + 1);
            Effect previousClickEffect = mainSequence.FindFirstAnimationForClick(clickNumber);

            bool hasClicksAfter = nextClickEffect != null;
            bool hasClickBefore = previousClickEffect != null;

            if (hasClicksAfter)
            {
                addedEffect = InsertAnimationBeforeExisting(shape, nextClickEffect, effect);
            }
            else if (hasClickBefore)
            {
                addedEffect = AddShapeAsLastAutoplaying(shape, effect);
            }
            else
            {
                addedEffect = mainSequence.AddEffect(shape, effect);
            }

            return addedEffect;
        }
        private Effect InsertAnimationBeforeExisting(Shape shape, Effect existing, MsoAnimEffect effect)
        {
            var sequence = _slide.TimeLine.MainSequence;

            Effect newAnimation = sequence.AddEffect(shape, effect, MsoAnimateByLevel.msoAnimateLevelNone,
                MsoAnimTriggerType.msoAnimTriggerWithPrevious);
            newAnimation.MoveBefore(existing);

            return newAnimation;
        }
 private Effect InsertAnimationAtIndex(Shape shape, int index, MsoAnimEffect animationEffect,
     MsoAnimTriggerType triggerType)
 {
     var animationSequence = _slide.TimeLine.MainSequence;
     Effect effect = animationSequence.AddEffect(shape, animationEffect, MsoAnimateByLevel.msoAnimateLevelNone,
         triggerType);
     effect.MoveTo(index);
     return effect;
 }
Ejemplo n.º 12
0
 public Effect AddTriggerEffect(Shape pShape, MsoAnimEffect effectId, MsoAnimTriggerType trigger, Shape pTriggerShape, string bookmark = "", MsoAnimateByLevel Level = MsoAnimateByLevel.msoAnimateLevelNone)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 13
0
        private static void AddTriggerEffect(Shape triggerShape, List <Shape> shapesToAnimate, MsoAnimEffect effect, Sequence sequence)
        {
            // Add Entrance Effect
            for (int i = 0; i < shapesToAnimate.Count; i++)
            {
                Shape animationShape = shapesToAnimate[i];
                MsoAnimTriggerType triggerType;
                // The first shape will be triggered by the click to appear
                if (i == 0)
                {
                    triggerType = MsoAnimTriggerType.msoAnimTriggerOnShapeClick;
                    sequence.AddTriggerEffect(animationShape, effect, triggerType, triggerShape);
                }
                // Rest of the shapes will appear with the first shape
                else
                {
                    triggerType = MsoAnimTriggerType.msoAnimTriggerWithPrevious;
                    sequence.AddEffect(shapesToAnimate[i], effect,
                                       MsoAnimateByLevel.msoAnimateLevelNone, MsoAnimTriggerType.msoAnimTriggerWithPrevious);
                }
            }

            // Add Exit Effect to Shapes
            for (int i = 0; i < shapesToAnimate.Count; i++)
            {
                Shape animationShape = shapesToAnimate[i];
                MsoAnimTriggerType triggerType;
                Effect             effectInSequence;
                // The first shape will be triggered by the click to disappear
                if (i == 0)
                {
                    triggerType      = MsoAnimTriggerType.msoAnimTriggerOnShapeClick;
                    effectInSequence = sequence.AddTriggerEffect(animationShape, effect, triggerType, triggerShape);
                }
                // Rest of the shapes will disappear with the first shape
                else
                {
                    triggerType      = MsoAnimTriggerType.msoAnimTriggerWithPrevious;
                    effectInSequence = sequence.AddEffect(shapesToAnimate[i], effect,
                                                          MsoAnimateByLevel.msoAnimateLevelNone, MsoAnimTriggerType.msoAnimTriggerWithPrevious);
                }
                effectInSequence.Exit = Microsoft.Office.Core.MsoTriState.msoTrue;
            }
        }
Ejemplo n.º 14
0
 public Effect AddTriggerEffect(Shape pShape, MsoAnimEffect effectId, MsoAnimTriggerType trigger, Shape pTriggerShape, string bookmark = "", MsoAnimateByLevel Level = MsoAnimateByLevel.msoAnimateLevelNone)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 15
0
 public Effect AddEffect(Shape Shape, MsoAnimEffect effectId, MsoAnimateByLevel Level = MsoAnimateByLevel.msoAnimateLevelNone, MsoAnimTriggerType trigger = MsoAnimTriggerType.msoAnimTriggerOnPageClick, int Index = -1)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 16
0
 private static void OnSettingsDialogConfirmed(MsoAutoShapeType newShapeType, MsoAnimEffect newAnimationType)
 {
     ShapeType     = newShapeType;
     AnimationType = newAnimationType;
 }
 public Effect AddShapeAsLastAutoplaying(Shape shape, MsoAnimEffect effect)
 {
     Effect addedEffect = _slide.TimeLine.MainSequence.AddEffect(shape, effect,
         MsoAnimateByLevel.msoAnimateLevelNone, MsoAnimTriggerType.msoAnimTriggerWithPrevious);
     return addedEffect;
 }
Ejemplo n.º 18
0
 public Effect AddEffect(Shape Shape, MsoAnimEffect effectId, MsoAnimateByLevel Level = MsoAnimateByLevel.msoAnimateLevelNone, MsoAnimTriggerType trigger = MsoAnimTriggerType.msoAnimTriggerOnPageClick, int Index = -1)
 {
     throw new NotImplementedException();
 }