private DiffBuilder(IRefCounted <ReferencePair> refCountedPair, MemberSettings settings) { this.refCountedPair = refCountedPair; this.settings = settings; this.borrowedDiffs = DictionaryPool <object, SubDiff> .Borrow(); this.borrowedSubBuilders = DictionaryPool <object, IRefCounted <DiffBuilder> > .Borrow(); this.valueDiff = new ValueDiff(refCountedPair.Value.X, refCountedPair.Value.Y, this.diffs); }
internal static MemberDiff Create(MemberInfo member, ValueDiff diff) { if (member is FieldInfo fieldInfo) { return(new FieldDiff(fieldInfo, diff)); } if (member is PropertyInfo propertyInfo) { return(new PropertyDiff(propertyInfo, diff)); } throw Throw.ExpectedParameterOfTypes <PropertyInfo, FieldInfo>("MemberDiff.Create(MemberInfo member, object xValue, object yValue)"); }
internal static MemberDiff Create(MemberInfo member, ValueDiff diff) { var fieldInfo = member as FieldInfo; if (fieldInfo != null) { return new FieldDiff(fieldInfo, diff); } var propertyInfo = member as PropertyInfo; if (propertyInfo != null) { return new PropertyDiff(propertyInfo, diff); } throw Throw.ExpectedParameterOfTypes<PropertyInfo, FieldInfo>("MemberDiff.Create(MemberInfo member, object xValue, object yValue)"); }
internal static MemberDiff Create(MemberInfo member, ValueDiff diff) { var fieldInfo = member as FieldInfo; if (fieldInfo != null) { return(new FieldDiff(fieldInfo, diff)); } var propertyInfo = member as PropertyInfo; if (propertyInfo != null) { return(new PropertyDiff(propertyInfo, diff)); } throw Throw.ExpectedParameterOfTypes <PropertyInfo, FieldInfo>("MemberDiff.Create(MemberInfo member, object xValue, object yValue)"); }
/// <summary>Initializes a new instance of the <see cref="MemberDiff"/> class.</summary> /// <param name="memberInfo">The member.</param> /// <param name="diff">The diff.</param> protected MemberDiff(MemberInfo memberInfo, ValueDiff diff) : base(diff) { this.MemberInfo = memberInfo; }
/// <summary> Initializes a new instance of the <see cref="IndexDiff"/> class.</summary> /// <param name="index">The property.</param> /// <param name="valueDiff">The <see cref="ValueDiff"/> for the <paramref name="index"/></param> public IndexDiff(object index, ValueDiff valueDiff) : base(valueDiff) { this.Index = index; }
/// <summary> Initializes a new instance of the <see cref="FieldDiff"/> class.</summary> /// <param name="fieldInfo">The field.</param> /// <param name="diff">The <see cref="ValueDiff"/> for the <paramref name="fieldInfo"/></param> public FieldDiff(FieldInfo fieldInfo, ValueDiff diff) : base(fieldInfo, diff) { }
/// <summary> Initializes a new instance of the <see cref="PropertyDiff"/> class.</summary> /// <param name="propertyInfo">The property.</param> /// <param name="diff">The <see cref="ValueDiff"/> for the <paramref name="propertyInfo"/></param> public PropertyDiff(PropertyInfo propertyInfo, ValueDiff diff) : base(propertyInfo, diff) { }
/// <summary> Initializes a new instance of the <see cref="MemberDiff{T}"/> class.</summary> /// <param name="memberInfo">The member.</param> /// <param name="diff">The <see cref="ValueDiff"/> for the <paramref name="memberInfo"/></param> protected MemberDiff(TMember memberInfo, ValueDiff diff) : base(memberInfo, diff) { }