public override DataDiff Diff(Data other) { if (Equals(this, other)) { return DataDiff.Empty; } return new GeneralDiff(this, other); }
public DataList(Data[] values) { m_Values = values; }
public abstract DataDiff Diff(Data other);
public override DataDiff Diff(Data other) { DataValue value = other as DataValue; if (value != null) { object old = m_Primitive; object new_ = value.m_Primitive; if (Equals(old, new_)) { return DataDiff.Empty; } Type oldType = old.GetType(); Type newType = new_.GetType(); if (oldType == newType) { if (oldType == typeof(float)) { return new FloatDiff((float)old, (float)new_); } if (oldType == typeof(double)) { return new DoubleDiff((double)old, (double)new_); } } } return new GeneralDiff(this, other); }
public override DataDiff Diff(Data other) { DataObject obj = other as DataObject; if (obj != null && String.Equals(m_Type, obj.m_Type, StringComparison.Ordinal)) { return new ObjectDiff(m_Fields, obj.m_Fields); } return new GeneralDiff(this, other); }
public GeneralDiff(Data old, Data new_) { m_Old = old; m_New = new_; }