コード例 #1
0
        public void SetValue(EntityMemberInfo member, object value)
        {
            // if we are loading the record, just set the value and that's it.
            if (_status == EntityStatus.Loading || Session == null)
            {
                member.SetValueRef(this, member, value);
                return;
            }
            if (_status == EntityStatus.Stub)
            {
                this.Reload();
            }
            var oldStatus = _status;

            member.SetValueRef(this, member, value);
            //Fire modified event if necessary
            if (_status != oldStatus && _status == EntityStatus.Modified)
            {
                EntityInfo.Events.OnModified(this);
            }
            if (PropertyChanged != null)
            {
                OnPropertyChanged(member.MemberName);
                if (member.DependentMembers != null)
                {
                    for (int i = 0; i < member.DependentMembers.Length; i++) //for loop is more efficient
                    {
                        OnPropertyChanged(member.DependentMembers[i].MemberName);
                    }
                }
            }
        }
コード例 #2
0
ファイル: EntityRecord.cs プロジェクト: yuanfei05/vita
 public void SetValue(EntityMemberInfo member, object value)
 {
     // if we are loading the record, just set the value and that's it.
       if (_status == EntityStatus.Loading || Session == null) {
     member.SetValueRef(this, member, value);
     return;
       }
       if (_status == EntityStatus.Stub)
     this.Reload();
       var oldStatus = _status;
       // Go thru session. Authorization-enabled session will use this method to check permissions
       Session.RecordSetMemberValue(this, member, value);
       //Fire modified event if necessary
       if (_status != oldStatus && _status == EntityStatus.Modified) {
     EntityInfo.Events.OnModified(this);
     Session.Context.App.EntityEvents.OnModified(this);
       }
       if (PropertyChanged != null) {
     OnPropertyChanged(member.MemberName);
     if (member.DependentMembers != null)
       for (int i=0; i< member.DependentMembers.Length; i++) //for loop is more efficient
     OnPropertyChanged(member.DependentMembers[i].MemberName);
       }
 }
コード例 #3
0
 public virtual void RecordSetMemberValue(EntityRecord record, EntityMemberInfo member, object value)
 {
     member.SetValueRef(record, member, value);
 }