Example #1
0
        private void CreateAppearEffectAnimation(PowerPointSlide slide, ExplanationItem selfExplanationItem)
        {
            bool          isSeparateClick = selfExplanationItem.TriggerIndex == (int)TriggerType.OnClick || !selfExplanationItem.IsTriggerTypeComboBoxEnabled;
            List <Effect> effects         = new List <Effect>();

            if (selfExplanationItem.IsVoice)
            {
                Effect effect;
                if (selfExplanationItem.IsVoiceLabelInvalid)
                {
                    string defaultVoiceLabel = string.Format(ELearningLabText.AudioDefaultLabelFormat, AudioSettingService.selectedVoice.VoiceName);
                    effect = AudioService.CreateAppearEffectAudioAnimation(slide, selfExplanationItem.CaptionText, defaultVoiceLabel,
                                                                           selfExplanationItem.ClickNo, selfExplanationItem.tagNo, isSeparateClick);
                    selfExplanationItem.VoiceLabel = defaultVoiceLabel;
                }
                else
                {
                    effect = AudioService.CreateAppearEffectAudioAnimation(slide, selfExplanationItem.CaptionText, selfExplanationItem.VoiceLabel,
                                                                           selfExplanationItem.ClickNo, selfExplanationItem.tagNo, isSeparateClick);
                }
                if (effect != null)
                {
                    effects.Add(effect);
                }
            }
            if (selfExplanationItem.IsCallout)
            {
                string calloutText = selfExplanationItem.HasShortVersion ? selfExplanationItem.CalloutText : selfExplanationItem.CaptionText;
                Effect effect      = CalloutService.CreateAppearEffectCalloutAnimation(slide, calloutText,
                                                                                       selfExplanationItem.ClickNo, selfExplanationItem.tagNo, isSeparateClick);
                effects.Add(effect);
            }
            else
            {
                CalloutService.DeleteCalloutShape(slide, selfExplanationItem.tagNo);
            }
            if (selfExplanationItem.IsCaption)
            {
                Effect effect = CaptionService.CreateAppearEffectCaptionAnimation(slide, selfExplanationItem.CaptionText,
                                                                                  selfExplanationItem.ClickNo, selfExplanationItem.tagNo, isSeparateClick);
                effects.Add(effect);
            }
            else
            {
                CaptionService.DeleteCaptionShape(slide, selfExplanationItem.tagNo);
            }
            if (isSeparateClick && effects.Count() > 0 && selfExplanationItem.ClickNo > 0)
            {
                effects.First().Timing.TriggerType = MsoAnimTriggerType.msoAnimTriggerOnPageClick;
            }
        }
Example #2
0
 public void DeleteShapesForUnusedItem(PowerPointSlide slide, ExplanationItem selfExplanationClickItem)
 {
     CalloutService.DeleteCalloutShape(slide, selfExplanationClickItem.tagNo);
     CaptionService.DeleteCaptionShape(slide, selfExplanationClickItem.tagNo);
 }