Description
The Icon
property of the MemberDescription
class provides the icon associated with a member, if specified using the [Icon]
attribute. This property is useful for retrieving a visual representation of the member, which can be used in user interfaces or documentation to enhance the visual context.
Usage
To access the Icon
property, you need to have an instance of the MemberDescription
class. Once you have the instance, you can simply get the value of the Icon
property to retrieve the icon string.
Example
// Assuming 'memberDescription' is an instance of MemberDescription
string icon = memberDescription.Icon;
// Use the icon string as needed, for example, to display in a UI
if (!string.IsNullOrEmpty(icon))
{
// Display the icon
// Example: Load the icon from resources or a file path
}