A System.Reflection.MethodInfo object representing the Set method for this property. The set accessor is public.
-or-
nonPublic is true and the set accessor is non-public.
null nonPublic is true, but the property is read-only.
-or-
nonPublic is false and the set accessor is non-public.
-or-
There is no set accessor.
Type Reason MethodAccessException nonPublic is true, the Set accessor for the property reflected by the current instance is non-public, and the caller does not have System.Security.Permissions.ReflectionPermission to reflect on non-public methods.
To use the GetSetMethod method, first get the class Type. From the Type, get the System.Reflection.PropertyInfo. From the PropertyInfo, use the GetSetMethod method.
Type | Reason |
---|---|
System.Security.Permissions.ReflectionPermission | Requires permission to reflect non-public members of a type in loaded assemblies. See System.Security.Permissions.ReflectionPermissionFlag.TypeInformation. |