Exemple #1
0
 public static void MoveVertexAnimations(SceneElement source, PropertyReference sourceReferencePrefix, SceneElement destination, PropertyReference destinationReferencePrefix, Transform transform, PathAnimationMovePackage animationMove)
 {
     foreach (StoryboardTimelineSceneNode parent in source.ViewModel.AnimationEditor.EnumerateStoryboardsForContainer(source.StoryboardContainer))
     {
         foreach (TimelineSceneNode timeline1 in (IEnumerable <TimelineSceneNode>)parent.Children)
         {
             if (timeline1.TargetElement == source && timeline1.TargetProperty != null && sourceReferencePrefix.IsPrefixOf(timeline1.TargetProperty))
             {
                 PropertyReference propertyReference = destinationReferencePrefix;
                 for (int count = sourceReferencePrefix.Count; count < timeline1.TargetProperty.Count; ++count)
                 {
                     propertyReference = propertyReference.Append(timeline1.TargetProperty[count]);
                 }
                 TimelineSceneNode timeline2 = (TimelineSceneNode)source.ViewModel.GetSceneNode(timeline1.DocumentNode.Clone(timeline1.DocumentContext));
                 if (transform != null)
                 {
                     PathCommandHelper.ApplyTransformToAnimation(timeline2, transform);
                 }
                 timeline2.TargetProperty = propertyReference;
                 timeline2.TargetElement  = (SceneNode)destination;
                 animationMove.Add(parent, timeline2);
                 animationMove.Remove(parent, timeline1);
             }
         }
     }
 }
 public void ApplyTransformToNewAnimations(Transform transform)
 {
     foreach (KeyValuePair <StoryboardTimelineSceneNode, TimelineSceneNode> keyValuePair in this.toAdd)
     {
         PathCommandHelper.ApplyTransformToAnimation(keyValuePair.Value, transform);
     }
 }