Class ConvertibleConverterDictionary
Represents a collection of function delegates that converts an IConvertible implementation to its byte[] equivalent.
Implements
Namespace: Cuemon
Assembly: Cuemon.Core.dll
Syntax
public class ConvertibleConverterDictionary : IReadOnlyDictionary<Type, Func<IConvertible, byte[]>>, IReadOnlyCollection<KeyValuePair<Type, Func<IConvertible, byte[]>>>, IEnumerable<KeyValuePair<Type, Func<IConvertible, byte[]>>>, IEnumerable
Properties
| Improve this Doc View SourceCount
Gets the number of converters contained in this instance.
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
Int32 | The number of converters contained in this instance. |
Item[Type]
Gets the function delegate that converts an IConvertible implementation to its byte[] equivalent from the specified type
.
Declaration
public Func<IConvertible, byte[]> this[Type type] { get; }
Parameters
Type | Name | Description |
---|---|---|
Type | type | The type that implements IConvertible. |
Property Value
Type | Description |
---|---|
Func<IConvertible, Byte[]> | The function delegate associated with the specified |
Keys
Gets an enumerable collection that contains the keys in the dictionary.
Declaration
public IEnumerable<Type> Keys { get; }
Property Value
Type | Description |
---|---|
IEnumerable<Type> | An enumerable collection that contains the keys in the dictionary. |
Values
Gets an enumerable collection that contains the values in the dictionary.
Declaration
public IEnumerable<Func<IConvertible, byte[]>> Values { get; }
Property Value
Type | Description |
---|---|
IEnumerable<Func<IConvertible, Byte[]>> | An enumerable collection that contains the values in the dictionary. |
Methods
| Improve this Doc View SourceAdd(Type, Func<IConvertible, Byte[]>)
Adds the function delegate that converts an IConvertible implementation to its byte[] equivalent to the specified type
.
Declaration
public ConvertibleConverterDictionary Add(Type type, Func<IConvertible, byte[]> converter)
Parameters
Type | Name | Description |
---|---|---|
Type | type | The type that implements IConvertible. |
Func<IConvertible, Byte[]> | converter | The function delegate that converts an IConvertible implementation to its byte[] equivalent. |
Returns
Type | Description |
---|---|
ConvertibleConverterDictionary | An ConvertibleConverterDictionary that can be used to further configure other converters. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
Add<T>(Func<T, Byte[]>)
Adds the function delegate that converts an IConvertible implementation to its byte[] equivalent to the specified T
.
Declaration
public ConvertibleConverterDictionary Add<T>(Func<T, byte[]> converter)
where T : IConvertible
Parameters
Type | Name | Description |
---|---|---|
Func<T, Byte[]> | converter | The function delegate that converts an IConvertible implementation to its byte[] equivalent. |
Returns
Type | Description |
---|---|
ConvertibleConverterDictionary | An ConvertibleConverterDictionary that can be used to further configure other converters. |
Type Parameters
Name | Description |
---|---|
T | The type that implements IConvertible. |
Exceptions
Type | Condition |
---|---|
TypeArgumentOutOfRangeException |
|
ContainsKey(Type)
Determines whether the dictionary contains an element that has the specified key.
Declaration
public bool ContainsKey(Type key)
Parameters
Type | Name | Description |
---|---|---|
Type | key | The key to locate. |
Returns
Type | Description |
---|---|
Boolean |
|
GetEnumerator()
Returns an enumerator that iterates through the collection.
Declaration
public IEnumerator<KeyValuePair<Type, Func<IConvertible, byte[]>>> GetEnumerator()
Returns
Type | Description |
---|---|
IEnumerator<KeyValuePair<Type, Func<IConvertible, Byte[]>>> | An enumerator that can be used to iterate through the collection. |
TryGetValue(Type, out Func<IConvertible, Byte[]>)
Gets the value that is associated with the specified key.
Declaration
public bool TryGetValue(Type key, out Func<IConvertible, byte[]> value)
Parameters
Type | Name | Description |
---|---|---|
Type | key | The key to locate. |
Func<IConvertible, Byte[]> | value | When this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the value parameter. This parameter is passed uninitialized. |
Returns
Type | Description |
---|---|
Boolean |
|
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Explicit Interface Implementations
| Improve this Doc View SourceIEnumerable.GetEnumerator()
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type | Description |
---|---|
IEnumerator |