Inheritance: MemberRef
Beispiel #1
0
        /// <summary>
        /// Returns the member reference which refers specified member.
        /// </summary>
        /// <param name="member">The member to refer.</param>
        /// <returns>The member reference which refers specified member.</returns>
        public static MemberRef Serialize(MemberInfo member)
        {
            switch (member.MemberType)
            {
            case MemberTypes.Constructor:
            case MemberTypes.Method:
                return(MethodRef.Serialize((MethodBase)member));

            case MemberTypes.Event:
                return(EventRef.Serialize((EventInfo)member));

            case MemberTypes.Field:
                return(FieldRef.Serialize((FieldInfo)member));

            case MemberTypes.Property:
                return(PropertyRef.Serialize((PropertyInfo)member));

            default:
                throw new ArgumentOutOfRangeException("member.MemberType");
            }
        }