Beispiel #1
0
        /// <summary>
        /// Gets all members.
        /// </summary>
        /// <param name="obj">Any object to browse </param>
        /// <returns>List of members</returns>
        internal static List <IMessageMember> GetMembers(object obj)
        {
            if (null == obj)
            {
                return(null);
            }

            Type objType = obj.GetType();
            List <IMessageMember> result = new List <IMessageMember>();

            FieldInfo[] fields = objType.GetFields(_filter);
            foreach (FieldInfo fieldInfo in fields)
            {
                IMessageMember oField;
                if (IsCollection(fieldInfo.GetValue(obj)))
                {
                    oField = new MessageFields(fieldInfo, obj);
                }
                else
                {
                    oField = new MessageField(fieldInfo, obj);
                }
                result.Add(oField);
            }


            return(result);
        }
Beispiel #2
0
        /// <summary>
        /// Gets all members.
        /// </summary>
        /// <param name="obj">Any object to browse </param>
        /// <returns>List of members</returns>
        internal static List<IMessageMember> GetMembers(object obj)
        {
            if (null == obj)
            {
                return null;
            }

            Type objType = obj.GetType();            
            List<IMessageMember> result = new List<IMessageMember>();

            FieldInfo[] fields = objType.GetFields(_filter);
            foreach (FieldInfo fieldInfo in fields )
            {
                IMessageMember oField;
                if (IsCollection(fieldInfo.GetValue(obj)))
                {
                    oField = new MessageFields(fieldInfo, obj);
                }
                else
                {
                    oField = new MessageField(fieldInfo, obj);
                }
                result.Add(oField);
            }


            return  result ;
        }