Class
EnumBinder

Provides functionality for binding enum values to UI components.

Definition

Constructors

EnumBinder()

Initializes a new instance of the EnumBinder class.

Declaration

cs-api-definition
public EnumBinder()

EnumBinder(Type)

Initializes a new instance of the EnumBinder class with the specified source enum type.

Declaration

cs-api-definition
public EnumBinder(Type source)

Parameters

source

Type

The enum type to bind to.

Properties

Count

Gets the number of EnumDescriptors in the collection.

Declaration

cs-api-definition
[Browsable(false)]
public int Count { get; }

Property Value

int

IsReadOnly

Gets a value indicating whether the collection is read-only.

Declaration

cs-api-definition
[Browsable(false)]
public bool IsReadOnly { get; }

Property Value

bool

Source

Gets or sets the source enum type.

Declaration

cs-api-definition
public Type Source { get; set; }

Property Value

Type

Target

Gets or sets the target object to bind the enum values to.

Declaration

cs-api-definition
public object Target { get; set; }

Property Value

object

Methods

Bind(object)

Binds the enum values to the specified target object.

Declaration

cs-api-definition
public bool Bind(object target)

Parameters

target

object

The target object to bind the enum values to.

Returns

bool

true if the binding was successful; otherwise, false.

Exceptions

ArgumentNullException

Thrown when target is null.

Contains(EnumDescriptor)

Determines whether the EnumBinder contains a specific EnumDescriptor.

Declaration

cs-api-definition
public bool Contains(EnumDescriptor item)

Parameters

item

EnumDescriptor

The EnumDescriptor to locate.

Returns

bool

true if the EnumDescriptor is found; otherwise, false.

CopyTo(EnumDescriptor[], int)

Copies the EnumDescriptors to an array, starting at a particular index.

Declaration

cs-api-definition
public void CopyTo(EnumDescriptor[] array, int arrayIndex)

Parameters

array

EnumDescriptor[]

The destination array.

arrayIndex

int

The index at which to start copying.

GetEnumerator()

Returns an enumerator that iterates through the EnumDescriptor collection.

Declaration

cs-api-definition
public IEnumerator<EnumDescriptor> GetEnumerator()

Returns

IEnumerator<EnumDescriptor>

An enumerator for the EnumDescriptor collection.

Operators

implicit operator EnumBinder(Type)

Provides an implicit conversion from Type to EnumBinder.

Declaration

cs-api-definition
public static implicit operator EnumBinder(Type source)

Parameters

source

Type

The enum type to convert from.

Returns

EnumBinder

A new EnumBinder instance for the specified enum type.