Exemple #1
0
        // Token: 0x06000516 RID: 1302 RVA: 0x00031528 File Offset: 0x0002F728
        public static MemberInfo GetMemberInfo(Type type, string name)
        {
            PropertyInfo propertyInfo = null;

            if (propertyInfo == null)
            {
                propertyInfo = type.GetProperty(name, BindingFlags.Instance | BindingFlags.NonPublic);
            }
            if (propertyInfo == null)
            {
                propertyInfo = type.GetProperty(name, BindingFlags.Static | BindingFlags.NonPublic);
            }
            if (propertyInfo != null)
            {
                return(propertyInfo);
            }
            FieldInfo fieldInfo = null;

            if (fieldInfo == null)
            {
                fieldInfo = type.GetField(name, BindingFlags.Instance | BindingFlags.NonPublic);
            }
            if (fieldInfo == null)
            {
                fieldInfo = type.GetField(name, BindingFlags.Static | BindingFlags.NonPublic);
            }
            if (fieldInfo == null && type.BaseType != null)
            {
                return(MemberInfoExtension.GetMemberInfo(type.BaseType, name));
            }
            return(fieldInfo);
        }
Exemple #2
0
 // Token: 0x06000517 RID: 1303 RVA: 0x0000547D File Offset: 0x0000367D
 public static MemberInfo GetMemberInfo(this object obj, string name)
 {
     return(MemberInfoExtension.GetMemberInfo(obj.GetType(), name));
 }