public override object CalculateAnimatedValue(object startValue, object endValue, object currValue, object step, int currFrameNum, int totalFrameNum, EasingCalculator calc) { Font origial = (Font)currValue; FontAnimationStep fontStep = (FontAnimationStep)step; return(new Font(origial.FontFamily, origial.Size + fontStep.SizeStep)); }
public override string ConvertAnimationStepToString(object value) { FontAnimationStep step = value as FontAnimationStep; if (step != null) { return(step.SizeStep.ToString(AnimationValueCalculatorFactory.SerializationCulture)); } return(null); }
private void FontAnimationForm_Load(object sender, EventArgs e) { if (AnimatedSetting.Step != null) { //TODO: What if the step is different type? FontAnimationStep step = (FontAnimationStep)XmlAnimatedPropertySetting.DeserializeStep(AnimatedSetting.Step); this.tbStepSize.Text = step.SizeStep.ToString(); } else { this.checkBoxUseCurrentValue.Checked = true; } if (AnimatedSetting.ReverseStep != null) { //TODO: What if the step is different type? FontAnimationStep step = (FontAnimationStep)XmlAnimatedPropertySetting.DeserializeStep(AnimatedSetting.ReverseStep); this.tbReversedStepSize.Text = step.SizeStep.ToString(); } if (AnimatedSetting.Value != null) { this.tbStartSize.Text = ((Font)AnimatedSetting.Value).Size.ToString(); //((Font)XmlPropertySetting.DeserializeValue(Property, AnimatedSetting.Value)).Size.ToString(); this.checkBoxUseCurrentValue.Checked = false; } else { this.checkBoxUseCurrentValue.Checked = true; } if (AnimatedSetting.EndValue != null) { this.tbEndSize.Text = ((Font)AnimatedSetting.EndValue).Size.ToString(); //((Font)XmlPropertySetting.DeserializeValue(Property, AnimatedSetting.EndValue)).Size.ToString(); } if (AnimatedSetting.ReverseStep == null) { this.checkBoxAutomaticReverse.Checked = true; } }
public override object CalculateInversedStep(object step) { FontAnimationStep fontStep = (FontAnimationStep)step; return(new FontAnimationStep(-fontStep.SizeStep)); }