private void ChangeAnimationProperty(PropertyReference fromProperty, PropertyReference toProperty, Dictionary <TimelineSceneNode, StoryboardTimelineSceneNode> toAdd, Dictionary <TimelineSceneNode, StoryboardTimelineSceneNode> toRemove, bool exactMatch) { foreach (StoryboardTimelineSceneNode timelineSceneNode in this.targetElement.ViewModel.AnimationEditor.EnumerateStoryboardsForContainer(this.targetElement.StoryboardContainer)) { foreach (TimelineSceneNode timeline in (IEnumerable <TimelineSceneNode>)timelineSceneNode.Children) { if (timeline.TargetElement == this.targetElement && timeline.TargetProperty != null) { PropertyReference propertyReference = toProperty; bool flag1 = AnimationProxyManager.IsOptimizedAnimation(timeline); bool flag2 = !flag1 && fromProperty.Equals((object)timeline.TargetProperty); if (!flag1 && !exactMatch && !flag2) { flag2 = fromProperty.IsPrefixOf(timeline.TargetProperty); if (flag2) { for (int count = toProperty.Count; count < timeline.TargetProperty.Count; ++count) { propertyReference = propertyReference.Append(timeline.TargetProperty[count]); } } } if (flag2) { if (toRemove != null) { toRemove[timeline] = timelineSceneNode; } TimelineSceneNode index = (TimelineSceneNode)this.targetElement.ViewModel.GetSceneNode(timeline.DocumentNode.Clone(timeline.DocumentContext)); index.TargetProperty = propertyReference; index.ShouldSerialize = true; KeyFrameAnimationSceneNode animationSceneNode = index as KeyFrameAnimationSceneNode; if (animationSceneNode != null) { animationSceneNode.IsAnimationProxy = false; } toAdd[index] = timelineSceneNode; } } } } }
public AnimationSceneNode GetAnimation(SceneNode targetElement, PropertyReference targetProperty) { if (targetElement == null || targetProperty == null) { return((AnimationSceneNode)null); } StyleNode styleNode = targetElement as StyleNode; if (styleNode != null) { BaseFrameworkElement targetElement1 = styleNode.TargetElement; } PropertyReference propertyReference = targetProperty; if (propertyReference == null) { return((AnimationSceneNode)null); } string path = propertyReference.Path; foreach (TimelineSceneNode timelineSceneNode in (IEnumerable <TimelineSceneNode>) this.Children) { AnimationSceneNode animationSceneNode = timelineSceneNode as AnimationSceneNode; if (animationSceneNode != null) { TimelineSceneNode.PropertyNodePair elementAndProperty = animationSceneNode.TargetElementAndProperty; if (elementAndProperty.SceneNode == targetElement && elementAndProperty.PropertyReference != null && (elementAndProperty.PropertyReference.Path == path && !AnimationProxyManager.IsOptimizedAnimation((TimelineSceneNode)animationSceneNode))) { return(animationSceneNode); } } } return((AnimationSceneNode)null); }
private void RemoveAnimation(PropertyReference animationPrefix, Dictionary <TimelineSceneNode, StoryboardTimelineSceneNode> toRemove) { foreach (StoryboardTimelineSceneNode timelineSceneNode in this.targetElement.ViewModel.AnimationEditor.EnumerateStoryboardsForContainer(this.targetElement.StoryboardContainer)) { foreach (TimelineSceneNode timeline in (IEnumerable <TimelineSceneNode>)timelineSceneNode.Children) { if (timeline.TargetElement == this.targetElement && timeline.TargetProperty != null && !AnimationProxyManager.IsOptimizedAnimation(timeline) && (animationPrefix.Equals((object)timeline.TargetProperty) || animationPrefix.IsPrefixOf(timeline.TargetProperty))) { toRemove[timeline] = timelineSceneNode; } } } }