PropertyInfo::GetAccessors Method ()
Returns an array whose elements reflect the public get and set accessors of the property reflected by the current instance.
Assembly: mscorlib (in mscorlib.dll)
Return Value
Type: array<System.Reflection::MethodInfo^>^An array of MethodInfo objects that reflect the public get and set accessors of the property reflected by the current instance, if found; otherwise, this method returns an array with zero (0) elements.
Implements
_PropertyInfo::GetAccessors()To call the GetAccessors method:
Get a Type object that represents the class.
From the Type object, get the PropertyInfo object.
From the PropertyInfo object, call the GetAccessors method.
The following example retrieves the public accessors of the ClassWithProperty.Caption property and displays information about them. It also calls the Invoke method of the setter to set the property value and of the getter to retrieve the property value.
when invoked late-bound through mechanisms such as Type::InvokeMember. Associated enumeration: ReflectionPermissionFlag::MemberAccess.
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0