Exemple #1
0
            public override DataDiff Diff(Data other)
            {
                if (Equals(this, other))
                {
                    return DataDiff.Empty;
                }

                return new GeneralDiff(this, other);
            }
Exemple #2
0
 public DataList(Data[] values)
 {
     m_Values = values;
 }
Exemple #3
0
 public abstract DataDiff Diff(Data other);
Exemple #4
0
            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);
            }
Exemple #5
0
            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);
            }
Exemple #6
0
 public GeneralDiff(Data old, Data new_)
 {
     m_Old = old;
     m_New = new_;
 }