Exemplo n.º 1
0
        protected sealed override PropertyInfo GetPropertyImpl(string name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers)
        {
            Debug.Assert(name != null);

            if (!OnlySearchRelatedBitsSet(bindingAttr))  // We don't yet have proper handling for BindingFlags not related to search so throw rather return a wrong result.
            {
                throw new NotImplementedException();
            }

            // GetPropertyImpl() is a funnel for two groups of api. We can distinguish by comparing "types" to null.
            if (types == null && returnType == null)
            {
                // Group #1: This group of api accept only a name and BindingFlags. The other parameters are hard-wired by the non-virtual api entrypoints.
                Debug.Assert(binder == null);
                Debug.Assert(modifiers == null);
                return(LowLevelTypeExtensions.GetProperty(this, name, bindingAttr));
            }
            else
            {
                if (!OnlySearchRelatedBitsSet(bindingAttr))  // We don't yet have proper handling for BindingFlags not related to search so throw rather return a wrong result.
                {
                    throw new NotImplementedException();
                }

                // Group #2: This group of api takes a set of parameter types, a return type (both cannot be null) and an optional binder.
                if (binder == null)
                {
                    binder = Type.DefaultBinder;
                }
                PropertyInfo[] candidates = LowLevelTypeExtensions.GetProperties(this, name, bindingAttr);
                return(binder.SelectProperty(bindingAttr, candidates, returnType, types, modifiers));
            }
        }
Exemplo n.º 2
0
 public sealed override Type GetNestedType(string name, BindingFlags bindingAttr) => LowLevelTypeExtensions.GetNestedType(this, name, bindingAttr);
Exemplo n.º 3
0
 public sealed override PropertyInfo[] GetProperties(BindingFlags bindingAttr) => LowLevelTypeExtensions.GetProperties(this, bindingAttr);
Exemplo n.º 4
0
 public sealed override MethodInfo[] GetMethods(BindingFlags bindingAttr) => LowLevelTypeExtensions.GetMethods(this, bindingAttr);
Exemplo n.º 5
0
 public sealed override Type[] GetNestedTypes(BindingFlags bindingAttr) => LowLevelTypeExtensions.GetNestedTypes(this, bindingAttr);
Exemplo n.º 6
0
 public sealed override MemberInfo[] GetMember(string name, BindingFlags bindingAttr) => LowLevelTypeExtensions.GetMember(this, name, bindingAttr);
Exemplo n.º 7
0
 public sealed override FieldInfo GetField(string name, BindingFlags bindingAttr) => LowLevelTypeExtensions.GetField(this, name, bindingAttr);
Exemplo n.º 8
0
 public sealed override EventInfo GetEvent(string name, BindingFlags bindingAttr) => LowLevelTypeExtensions.GetEvent(this, name, bindingAttr);
Exemplo n.º 9
0
 public sealed override EventInfo[] GetEvents(BindingFlags bindingAttr) => LowLevelTypeExtensions.GetEvents(this, bindingAttr);
Exemplo n.º 10
0
 public sealed override ConstructorInfo[] GetConstructors(BindingFlags bindingAttr) => LowLevelTypeExtensions.GetConstructors(this, bindingAttr);