コード例 #1
0
        protected static ReflectedMember CreateMemberDefinition(MemberInfo info)
        {
            MethodInfo method;
            FieldInfo field;
            PropertyInfo property;
            ConstructorInfo constructor;

            ReflectedMember md;
            if ((method = info as MethodInfo) != null)
            {
                md = new ReflectedMethod(method);
            }
            else if ((field = info as FieldInfo) != null)
            {
                md = new ReflectedField(field);
            }
            else if ((property = info as PropertyInfo) != null)
            {
                md = new ReflectedProperty(property);
            }
            else if ((constructor = info as ConstructorInfo) != null)
            {
                md = new ReflectedConstructor(constructor);
            }
            else
            {
                md = null;
            }

            return md;
        }