예제 #1
0
        public IAnimationElement SearchParentAnimationElement(AnimationRouteFrame routeFrame)
        {
            foreach (var frame in Route.Frames)
            {
                if (frame == routeFrame)
                {
                    return(this);
                }
            }

            foreach (var element in Elements)
            {
                if (element is AnimationSingleElement)
                {
                    var single       = element as AnimationSingleElement;
                    var singleResult = single.SearchParentAnimationElement(routeFrame);
                    if (singleResult != null)
                    {
                        return(singleResult);
                    }
                }
                if (element is AnimationGroupElement)
                {
                    var group       = element as AnimationGroupElement;
                    var groupResult = group.SearchParentAnimationElement(routeFrame);
                    if (groupResult != null)
                    {
                        return(groupResult);
                    }
                }
            }

            return(null);
        }
예제 #2
0
 public IAnimationElement SearchParentAnimationElement(AnimationRouteFrame routeFrame)
 {
     foreach (var AnimationElement in AnimationElements)
     {
         if (AnimationElement is AnimationSingleElement)
         {
             var single       = AnimationElement as AnimationSingleElement;
             var singleResult = single.SearchParentAnimationElement(routeFrame);
             if (singleResult != null)
             {
                 return(singleResult);
             }
         }
         if (AnimationElement is AnimationGroupElement)
         {
             var group       = AnimationElement as AnimationGroupElement;
             var groupResult = group.SearchParentAnimationElement(routeFrame);
             if (groupResult != null)
             {
                 return(groupResult);
             }
         }
     }
     return(null);
 }
예제 #3
0
 public AnimationSingleElement SearchParentAnimationElement(AnimationRouteFrame routeFrame)
 {
     foreach (var frame in Route.Frames)
     {
         if (frame == routeFrame)
         {
             return(this);
         }
     }
     return(null);
 }
예제 #4
0
        public void DuplicateLastFrame(TimeSpan ts)
        {
            var slider       = GetFrameSlider(ts);
            var newLastFrame = new AnimationRouteFrame();

            if (slider.PreviousFrame != null)
            {
                newLastFrame.Amplitude          = slider.PreviousFrame.Amplitude;
                newLastFrame.CheckpointPosition = slider.PreviousFrame.CheckpointPosition;
                newLastFrame.Cycles             = slider.PreviousFrame.Cycles;
                newLastFrame.SpeedAmplitude     = slider.PreviousFrame.SpeedAmplitude;
                newLastFrame.SpeedCycles        = slider.PreviousFrame.SpeedCycles;
                newLastFrame.SpeedPhase         = slider.PreviousFrame.SpeedPhase;
            }
            newLastFrame.FrameTime = ts;
            Frames.Add(newLastFrame);
        }