Пример #1
0
 public virtual void Clone(DbObject srcObj, bool notifyChanged = true)
 {
     if (!notifyChanged)
     {
         this.SuspendNotify();
     }
     CloneUtils.CloneObject <DbObject>(srcObj, this, new Expression <Func <DbObject, object> > [0]);
     CloneUtils.CloneObject <DbObjectState>(this.State, this.State, new Expression <Func <DbObjectState, object> > [0]);
     CloneUtils.CloneObject <DbObjectState>(this.previousState, this.previousState, new Expression <Func <DbObjectState, object> > [0]);
     if (!notifyChanged)
     {
         this.ResumeNotify();
     }
 }
Пример #2
0
        public void UpdateInitialValues(DbObject obj)
        {
            this.initialValues.Clear();
            DbObjectInfo dbObjectInfo = this.GetDbObjectInfo(obj.GetType());

            foreach (KeyValuePair <string, DynamicPropertyInfo> pair in dbObjectInfo.DynamicPropertyInfos)
            {
                string    key   = pair.Key;
                object    obj2  = obj.GetValue(key);
                ValueInfo info2 = new ValueInfo {
                    Value = obj2,
                    Name  = key
                };
                this.initialValues.Add(key, info2);
            }
        }
Пример #3
0
 public virtual bool Compare(DbObject obj)
 {
     return(DbObjectTools.Compare(this, obj));
 }