Description
The Unique
property of the EnumDescription
class provides an array of Entry
objects that represent unique entries within the enumeration. Each Entry
contains metadata about a specific value in the enumeration, such as its name and associated value.
Usage
To access the unique entries of an enumeration, you can use the Unique
property of an EnumDescription
instance. This property is useful when you need to iterate over or analyze the distinct values defined in an enumeration.
Example
// Example of accessing the Unique property
EnumDescription enumDescription = new EnumDescription();
Sandbox.EnumDescription.Entry[] uniqueEntries = enumDescription.Unique;
foreach (var entry in uniqueEntries)
{
// Access entry properties
Console.WriteLine($"Name: {entry.Name}, Value: {entry.Value}");
}