예제 #1
0
 public void SetState(VOState pState)
 {
     if (pState != null)
     {
         foreach (PropertyInfo info in mValueObjectInstance.GetType().GetProperties())
         {
             if (info.CanRead && info.CanWrite && mPropertyNames.Contains(info.Name))
             {
                 info.SetValue(mValueObjectInstance, pState.GetMember(info.Name), null);
             }
         }
     }
 }
예제 #2
0
        public bool StateIsEqualTo(VOState pState)
        {
            VOState       myState         = GetState();
            List <string> attributes      = myState.GetAttributes();
            List <string> otherAttributes = pState.GetAttributes();

            if (attributes.Count != pState.GetAttributes().Count)
            {
                return(false);
            }

            foreach (string attribute in attributes)
            {
                if (!myState.GetMember(attribute).Equals(pState.GetMember(attribute)) ||
                    !otherAttributes.Remove(attribute))
                {
                    return(false);
                }
            }

            return(true);
        }