예제 #1
0
        public override void SetValue(IDuration d)
        {
            duration_ = d as RampDuration;

            if (duration_ == null)
            {
                timeUp_.Value       = 0;
                timeDown_.Value     = 0;
                min_.Value          = 0;
                max_.Value          = 0;
                hold_.Value         = 0;
                rampUp_.Value       = false;
                rampDown_.Value     = false;
                rampUp_.Parameter   = null;
                rampDown_.Parameter = null;
            }
            else
            {
                timeUp_.Parameter   = duration_.TimeUpParameter;
                timeDown_.Parameter = duration_.TimeDownParameter;
                min_.Parameter      = duration_.MinimumParameter;
                max_.Parameter      = duration_.MaximumParameter;
                hold_.Parameter     = duration_.HoldParameter;
                rampUp_.Parameter   = duration_.RampUpParameter;
                rampDown_.Parameter = duration_.RampDownParameter;
            }

            easing_.Value = duration_.Easing;
        }
예제 #2
0
        public override IDuration Clone(int cloneFlags = 0)
        {
            var d = new RampDuration();

            CopyTo(d, cloneFlags);
            return(d);
        }
예제 #3
0
        public override void AddToUI(IDuration d)
        {
            duration_ = d as RampDuration;
            if (duration_ == null)
            {
                return;
            }

            foreach (var w in GetWidgets(d))
            {
                widgets_.AddToUI(w);
            }
        }
예제 #4
0
        private void CopyTo(RampDuration d, int cloneFlags)
        {
            d.easing_ = easing_?.Clone(cloneFlags);

            if (!Bits.IsSet(cloneFlags, Utilities.CloneZero))
            {
                d.min_.Value      = min_.Value;
                d.max_.Value      = max_.Value;
                d.timeUp_.Value   = timeUp_.Value;
                d.timeDown_.Value = timeDown_.Value;
                d.hold_.Value     = hold_.Value;
            }

            rampUp_.Value   = d.rampUp_.Value;
            rampDown_.Value = d.rampDown_.Value;
        }