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; } }
private void CreateExitEffectAnimation(PowerPointSlide slide, ExplanationItem selfExplanationItem) { string calloutShapeName = string.Format(ELearningLabText.CalloutShapeNameFormat, selfExplanationItem.tagNo); string captionShapeName = string.Format(ELearningLabText.CaptionShapeNameFormat, selfExplanationItem.tagNo); if (selfExplanationItem.IsCallout && slide.ContainShapeWithExactName(calloutShapeName)) { Shape calloutShape = slide.GetShapeWithName(calloutShapeName)[0]; CalloutService.CreateExitEffectCalloutAnimation(slide, calloutShape, selfExplanationItem.ClickNo); } if (selfExplanationItem.IsCaption && slide.ContainShapeWithExactName(captionShapeName)) { Shape captionShape = slide.GetShapeWithName(captionShapeName)[0]; CaptionService.CreateExitEffectCaptionAnimation(slide, captionShape, selfExplanationItem.ClickNo); } }
public void DeleteShapesForUnusedItem(PowerPointSlide slide, ExplanationItem selfExplanationClickItem) { CalloutService.DeleteCalloutShape(slide, selfExplanationClickItem.tagNo); CaptionService.DeleteCaptionShape(slide, selfExplanationClickItem.tagNo); }