Beispiel #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SimpleMagicPropertyInfo"/> class.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <param name="member">The member.</param>
        /// <param name="getMethod">The get method.</param>
        /// <param name="setMethod">The set method.</param>
        /// <param name="propertyType">Type of the property.</param>
        public SimpleMagicPropertyInfo(string name, MemberInfo member, MethodInfo getMethod, MethodInfo setMethod, EventPropertyType propertyType)
        {
            Name   = name;
            Member = member;

            if (member is PropertyInfo)
            {
                PropertyType = ((PropertyInfo)member).PropertyType;
            }
            else if (member is MethodInfo)
            {
                PropertyType = ((MethodInfo)member).ReturnType;
            }

            GetMethod         = getMethod;
            SetMethod         = setMethod;
            EventPropertyType = propertyType;
        }