New to Telerik UI for WinForms? Start a free 30-day trial

Provides functionality for binding enum values to UI components.

Definition

Namespace:Telerik.WinControls.UI.Data

Assembly:Telerik.WinControls.UI.dll

Syntax:

C#
[ComVisible(false)]
public class EnumBinder : Component, IComponent, IDisposable, IEnumerable

Inheritance: objectMarshalByRefObjectComponentEnumBinder

Implements: IComponentIDisposableIEnumerable

Constructors

Initializes a new instance of the EnumBinder class.

C#
public EnumBinder()

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

C#
public EnumBinder(Type source)
Parameters:sourceType

The enum type to bind to.

Properties

Gets the number of EnumDescriptors in the collection.

C#
[Browsable(false)]
public int Count { get; }

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

C#
[Browsable(false)]
public bool IsReadOnly { get; }

Gets or sets the source enum type.

C#
public Type Source { get; set; }

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

C#
public object Target { get; set; }

Methods

Binds the enum values to the specified target object.

C#
public bool Bind(object target)
Parameters:targetobject

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.

Determines whether the EnumBinder contains a specific EnumDescriptor.

C#
public bool Contains(EnumDescriptor item)
Parameters:itemEnumDescriptor

The EnumDescriptor to locate.

Returns:

bool

true if the EnumDescriptor is found; otherwise, false.

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

C#
public void CopyTo(EnumDescriptor[] array, int arrayIndex)
Parameters:arrayEnumDescriptor[]

The destination array.

arrayIndexint

The index at which to start copying.

Returns an enumerator that iterates through the EnumDescriptor collection.

C#
public IEnumerator<EnumDescriptor> GetEnumerator()
Returns:

IEnumerator<EnumDescriptor>

An enumerator for the EnumDescriptor collection.

Operators

Provides an implicit conversion from Type to EnumBinder.

C#
public static implicit operator EnumBinder(Type source)
Parameters:sourceType

The enum type to convert from.

Returns:

EnumBinder

A new EnumBinder instance for the specified enum type.