Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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)");
        }
Esempio n. 3
0
        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)");
        }
Esempio n. 4
0
        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)");
        }
Esempio n. 5
0
 /// <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;
 }
Esempio n. 6
0
 /// <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;
 }
Esempio n. 7
0
 /// <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)
 {
 }
Esempio n. 8
0
 /// <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;
 }
Esempio n. 9
0
 /// <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)
 {
 }
Esempio n. 10
0
 /// <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;
 }
Esempio n. 11
0
 /// <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)
 {
 }