This attribute is used to mark the visibility of a type member though reflection API.
By default, all the members of a user-defined type, regardless of the visibility as defined in source code, are exposed through reflection. So one can invoke a private method without any problem. This attribute can be used to suppress the visibility of members which are considered absolutely off-limit to any means of access.
System APIs, on the other hand, do not expose non-public members though reflection. This attribute is sometimes used to override the default behavior to grant visibility to certain non-public members. Such usage, however, is generally rare.
Type | Name | Signature |
---|---|---|
field | visible | public bool visible |
public bool visible
True to mark this member as visible to reflection API; false invisible.
Members of of user-defined types are default to visible unless this property overwrites it.