Mono Class Library: System.Type Overview | Members

System.Type.GetProperties Method

Returns an array of System.Reflection.PropertyInfo objects that reflect the properties defined for the type represented by the current instance that match the specified binding constraints.

public abstract System.Reflection.PropertyInfo[] GetProperties (System.Reflection.BindingFlags bindingAttr)

Parameters

bindingAttr
A bitwise combination of System.Reflection.BindingFlags values that control the binding process. If zero is specified, this method returns null .

Returns

An array of System.Reflection.PropertyInfo objects that reflect the properties defined in the type represented by the current instance and match the constraints of bindingAttr . If no matching properties are found, returns an empty array. If the type represented by the current instance is from a loaded assembly and the caller does not have permission to reflect on non-public objects in loaded assemblies, returns only public properties.

Permissions

TypeReason
System.Security.Permissions.ReflectionPermissionRequires permission to retrieve information on non-public members of types in loaded assemblies. See System.Security.Permissions.ReflectionPermissionFlag.TypeInformation.

Remarks

The following System.Reflection.BindingFlags are used to define which members to include in the search:

The following System.Reflection.BindingFlags values can be used to change how the search works:

Note: For more information, see System.Reflection.BindingFlags.

If the current instance represents a generic type, this method returns the System.Reflection.PropertyInfo objects with the type parameters replaced by the appropriate type arguments.

If the current instance represents an unassigned type parameter of a generic type or method, this method searches the properties of the class constraint; the properties of all interface constraints; and the properties of any interfaces inherited from class or interface constraints.

Operation
A property is considered by reflection to be public if it has at least one accessor that is public . Otherwise, the property is not public.

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0