Exemple #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);
             }
         }
     }
 }
Exemple #2
0
        public VOState GetState()
        {
            VOState result = new VOState();

            try
            {
                foreach (PropertyInfo info in mValueObjectInstance.GetType().GetProperties())
                {
                    if (info.CanRead && info.CanWrite && mPropertyNames.Contains(info.Name))
                    {
                        result.SetMember(info.Name, info.GetValue(mValueObjectInstance, null));
                    }
                }
            }
            catch (Exception e)
            {
                throw e;
            }

            return(result);
        }
Exemple #3
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);
        }
Exemple #4
0
 public void StoreState()
 {
     mLastStoredState = GetState();
 }