예제 #1
0
        private static PointKeyFrame CreatePointKeyFrmas(KeyFrames <Point> Model)
        {
            PointKeyFrame frame = null;

            switch (Model.Type)
            {
            case KeyFramesType.Spline: frame = new SplinePointKeyFrame()
            {
                    KeySpline = Model.Spline
            }; break;

            case KeyFramesType.Linear: frame = new LinearPointKeyFrame(); break;

            case KeyFramesType.Easing: frame = new EasingPointKeyFrame()
            {
                    EasingFunction = Model.EasingFunction
            }; break;

            case KeyFramesType.Discrete: frame = new DiscretePointKeyFrame(); break;

            default: break;
            }
            frame.KeyTime = KeyTime.FromTimeSpan(TimeSpan.FromSeconds(Model.KeyTime));
            frame.Value   = Model.Value;
            return(frame);
        }
예제 #2
0
        // Token: 0x06000D05 RID: 3333 RVA: 0x00030930 File Offset: 0x0002EB30
        private static Point?GetTargetPoint(Timeline timeline, bool isEntering)
        {
            PointAnimation pointAnimation = timeline as PointAnimation;

            if (pointAnimation != null)
            {
                if (pointAnimation.From == null)
                {
                    return(pointAnimation.To);
                }
                return(pointAnimation.From);
            }
            else
            {
                PointAnimationUsingKeyFrames pointAnimationUsingKeyFrames = timeline as PointAnimationUsingKeyFrames;
                if (pointAnimationUsingKeyFrames == null)
                {
                    return(null);
                }
                if (pointAnimationUsingKeyFrames.KeyFrames.Count == 0)
                {
                    return(null);
                }
                PointKeyFrame pointKeyFrame = pointAnimationUsingKeyFrames.KeyFrames[isEntering ? 0 : (pointAnimationUsingKeyFrames.KeyFrames.Count - 1)];
                return(new Point?(pointKeyFrame.Value));
            }
        }
예제 #3
0
        private static Point?GetTargetPoint(Timeline timeline, bool isEntering)
        {
            PointAnimation pa = timeline as PointAnimation;

            if (pa != null)
            {
                return(pa.From.HasValue ? pa.From : pa.To);
            }

            PointAnimationUsingKeyFrames pak = timeline as PointAnimationUsingKeyFrames;

            if (pak != null)
            {
                if (pak.KeyFrames.Count == 0)
                {
                    return(null);
                }

                PointKeyFrame keyFrame = pak.KeyFrames[isEntering ? 0 : pak.KeyFrames.Count - 1];
                return(keyFrame.Value);
            }

            return(null);
        }
예제 #4
0
 protected void ApplyPointKeyFrameProperties(PointKeyFrame pointKeyFrame, DeterministicRandom random)
 {
     pointKeyFrame.Value   = Value;
     pointKeyFrame.KeyTime = KeyTime;
 }
예제 #5
0
 private void OnAnimationBasisSubscriptionPathNodeChanged(object sender, SceneNode basisNode, PathElement basisContent, SceneNode newPathNode, PointKeyFrame newContent)
 {
     this.FireKeyframeUpdate();
 }
예제 #6
0
 private void animationSubscription_PathNodeContentChanged(object sender, SceneNode pathNode, PointKeyFrame content, DocumentNodeMarker damageMarker, DocumentNodeChange damage)
 {
     this.FireKeyframeUpdate();
 }