Class EnumBinder
Provides functionality for binding enum values to UI components.
Inheritance
Namespace: Telerik.WinControls.UI.Data
Assembly: Telerik.WinControls.UI.dll
Syntax
[ComVisible(false)]
public class EnumBinder : Component, ICollection<EnumDescriptor>, IEnumerable<EnumDescriptor>, IEnumerable
Constructors
EnumBinder()
EnumBinder(Type)
Initializes a new instance of the EnumBinder class with the specified source enum type.
Declaration
public EnumBinder(Type source)
Parameters
System.Type
source
The enum type to bind to. |
Properties
Count
Gets the number of EnumDescriptors in the collection.
Declaration
public int Count { get; }
Property Value
System.Int32
|
Implements
IsReadOnly
Gets a value indicating whether the collection is read-only.
Declaration
public bool IsReadOnly { get; }
Property Value
System.Boolean
|
Implements
Source
Gets or sets the source enum type.
Declaration
public Type Source { get; set; }
Property Value
System.Type
|
Target
Gets or sets the target object to bind the enum values to.
Declaration
public object Target { get; set; }
Property Value
System.Object
|
Methods
Bind(Object)
Binds the enum values to the specified target object.
Declaration
public bool Bind(object target)
Parameters
System.Object
target
The target object to bind the enum values to. |
Returns
System.Boolean
true if the binding was successful; otherwise, false. |
Exceptions
System.ArgumentNullException
Thrown when target is null. |
Contains(EnumDescriptor)
Determines whether the EnumBinder contains a specific EnumDescriptor.
Declaration
public bool Contains(EnumDescriptor item)
Parameters
EnumDescriptor
item
The EnumDescriptor to locate. |
Returns
System.Boolean
true if the EnumDescriptor is found; otherwise, false. |
Implements
CopyTo(EnumDescriptor[], Int32)
Copies the EnumDescriptors to an array, starting at a particular index.
Declaration
public void CopyTo(EnumDescriptor[] array, int arrayIndex)
Parameters
EnumDescriptor[]
array
The destination array. |
System.Int32
arrayIndex
The index at which to start copying. |
Implements
GetEnumerator()
Returns an enumerator that iterates through the EnumDescriptor collection.
Declaration
public IEnumerator<EnumDescriptor> GetEnumerator()
Returns
System.Collections.Generic.IEnumerator<EnumDescriptor>
An enumerator for the EnumDescriptor collection. |
Implements
Operators
Implicit(Type to EnumBinder)
Provides an implicit conversion from Type to EnumBinder.
Declaration
public static implicit operator EnumBinder(Type source)
Parameters
System.Type
source
The enum type to convert from. |
Returns
EnumBinder
A new EnumBinder instance for the specified enum type. |
Explicit Interface Implementations
ICollection<EnumDescriptor>.Add(EnumDescriptor)
Declaration
void ICollection<EnumDescriptor>.Add(EnumDescriptor item)
Parameters
EnumDescriptor
item
|
Implements
ICollection<EnumDescriptor>.Clear()
Declaration
void ICollection<EnumDescriptor>.Clear()
Implements
ICollection<EnumDescriptor>.Remove(EnumDescriptor)
Declaration
bool ICollection<EnumDescriptor>.Remove(EnumDescriptor item)
Parameters
EnumDescriptor
item
|
Returns
System.Boolean
|
Implements
IEnumerable.GetEnumerator()
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
System.Collections.IEnumerator
|