Returns an array containing the nested types defined in the type represented by the current instance that match the specified binding constraints.
- bindingAttr
- A bitwise combination of System.Reflection.BindingFlags values that control the binding process. If zero is specified, this method returns null .
An array of Type objects representing all types nested within the type represented by the current instance that match the specified binding constraints, if any. Otherwise, returns an empty Type array. If the type reflected by the current instance is contained in a loaded assembly, the type that matches the specified criteria is not public, and the caller does not have sufficient permission, returns only public types.
Type Reason System.Security.Permissions.ReflectionPermission Requires permission to retrieve information on non-public members of types in loaded assemblies. See System.Security.Permissions.ReflectionPermissionFlag.TypeInformation.
The following System.Reflection.BindingFlags are used to define which members to include in the search:
- Specify System.Reflection.BindingFlags.Public to include public members in the search.
- Specify System.Reflection.BindingFlags.NonPublic to include non-public members (that is, private and protected members) in the search.
The following System.Reflection.BindingFlags values can be used to change how the search works:
- System.Reflection.BindingFlags.DeclaredOnly to search only the members declared in the type, not members that were simply inherited.
Note: For more information, see System.Reflection.BindingFlags.If the current instance represents an unassigned type parameter of a generic type or method, this method searches the nested types of the class constraint.
Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0