Esempio n. 1
0
        /// <summary>
        ///  Returns the type that the get expects to receive as a parameter when
        ///  setting a member value.
        /// </summary>
        /// <param name="type">The type to check</param>
        /// <param name="memberName">The name of the member</param>
        /// <returns>The type of the member</returns>
        public static Type GetMemberTypeForGetter(Type type, string memberName)
        {
            if (memberName.IndexOf('.') > -1)
            {
                StringTokenizer parser     = new StringTokenizer(memberName, ".");
                IEnumerator     enumerator = parser.GetEnumerator();

                while (enumerator.MoveNext())
                {
                    memberName = (string)enumerator.Current;
                    type       = ReflectionInfo.GetInstance(type).GetGetterType(memberName);
                }
            }
            else
            {
                type = ReflectionInfo.GetInstance(type).GetGetterType(memberName);
            }

            return(type);
        }
Esempio n. 2
0
 /// <summary>
 /// Returns an array of the writeable members name exposed by a object
 /// </summary>
 /// <param name="obj">The object</param>
 /// <returns>The members name</returns>
 public static string[] GetWriteableMemberNames(object obj)
 {
     return(ReflectionInfo.GetInstance(obj.GetType()).GetWriteableMemberNames());
 }
Esempio n. 3
0
 /// <summary>
 /// Returns an array of the readable properties names exposed by an object
 /// </summary>
 /// <param name="obj">The object</param>
 /// <returns>The properties name</returns>
 public static string[] GetReadablePropertyNames(object obj)
 {
     return(ReflectionInfo.GetInstance(obj.GetType()).GetReadableMemberNames());
 }