/// <summary> /// Creates a new field animation. /// </summary> /// <param name="target">The animated object.</param> /// <param name="field">The field that is set when updating the animated value.</param> /// <param name="track">The animation track that is used as a data source.</param> public FieldAnimation(TObject target, FieldInfo field, AnimationTrack <TValue> track) : base(target, field.BuildFieldSetter <TObject, TValue>(), track) { if (target == null && !field.IsStatic) { throw new ArgumentNullException("target"); } this.field = field; }
/// <summary> /// Creates a new animation. /// </summary> /// <param name="target">The animated object.</param> /// <param name="setter">The setter that is invoked when updating the animated value.</param> /// <param name="track">The animation track that is used as a data source.</param> public Animation(TObject target, Action <TObject, TValue> setter, AnimationTrack <TValue> track) { if (setter == null) { throw new ArgumentNullException("setter"); } if (track == null) { throw new ArgumentNullException("track"); } this.target = target; this.setter = setter; this.track = track; }
/// <summary> /// Creates a new property animation. /// </summary> /// <param name="target">The animated object.</param> /// <param name="field">The property that is set when updating the animated value.</param> /// <param name="track">The animation track that is used as a data source.</param> public PropertyAnimation(TObject target, PropertyInfo property, AnimationTrack<TValue> track) : base(target, property.BuildPropertySetter<TObject,TValue>(), track) { if (target == null && !property.GetSetMethod().IsStatic) throw new ArgumentNullException("target"); this.property = property; }