Parameters

A bitmask comprised of one or more BindingFlags that specify how the search is conducted.

-or-

Zero, to return null.

Return Value

Type: System.Reflection.PropertyInfo[]An array of PropertyInfo objects representing all properties of the current Type that match the specified binding constraints.-or- An empty array of type PropertyInfo, if the current Type does not have properties, or if none of the properties match the binding constraints.

The GetProperties method does not return properties in a particular order, such as alphabetical or declaration order. Your code must not depend on the order in which properties are returned, because that order varies.

The following BindingFlags filter flags can be used to define which nested types to include in the search:

You must specify either BindingFlags.Instance or BindingFlags.Static in order to get a return.

Specify BindingFlags.Public to include public properties in the search.

Specify BindingFlags.NonPublic to include non-public properties (that is, private, internal, and protected properties) in the search. Only protected and internal properties on base classes are returned; private properties on base classes are not returned.

Specify BindingFlags.FlattenHierarchy to include public and protected static members up the hierarchy; private static members in inherited classes are not included.

The following BindingFlags modifier flags can be used to change how the search works:

BindingFlags.DeclaredOnly to search only the properties declared on the Type, not properties that were simply inherited.