Class ConvertibleConverterDictionary
- Namespace
- Cuemon
- Assembly
- Cuemon.Core.dll
Represents a collection of function delegates that converts an IConvertible implementation to its byte[] equivalent.
public class ConvertibleConverterDictionary : IReadOnlyDictionary<Type, Func<IConvertible, byte[]>>, IReadOnlyCollection<KeyValuePair<Type, Func<IConvertible, byte[]>>>, IEnumerable<KeyValuePair<Type, Func<IConvertible, byte[]>>>, IEnumerable- Inheritance
- 
      
      ConvertibleConverterDictionary
- Implements
Properties
Count
Gets the number of converters contained in this instance.
public int Count { get; }Property Value
- int
- The number of converters contained in this instance. 
this[Type]
Gets the function delegate that converts an IConvertible implementation to its byte[] equivalent from the specified type.
public Func<IConvertible, byte[]> this[Type type] { get; }Parameters
- typeType
- The type that implements IConvertible. 
Property Value
- Func<IConvertible, byte[]>
- The function delegate associated with the specified - type; null if no association exists.
Keys
Gets an enumerable collection that contains the keys in the dictionary.
public IEnumerable<Type> Keys { get; }Property Value
- IEnumerable<Type>
- An enumerable collection that contains the keys in the dictionary. 
Values
Gets an enumerable collection that contains the values in the dictionary.
public IEnumerable<Func<IConvertible, byte[]>> Values { get; }Property Value
- IEnumerable<Func<IConvertible, byte[]>>
- An enumerable collection that contains the values in the dictionary. 
Methods
Add(Type, Func<IConvertible, byte[]>)
Adds the function delegate that converts an IConvertible implementation to its byte[] equivalent to the specified type.
public ConvertibleConverterDictionary Add(Type type, Func<IConvertible, byte[]> converter)Parameters
- typeType
- The type that implements IConvertible. 
- converterFunc<IConvertible, byte[]>
- The function delegate that converts an IConvertible implementation to its byte[] equivalent. 
Returns
- ConvertibleConverterDictionary
- An ConvertibleConverterDictionary that can be used to further configure other converters. 
Exceptions
- ArgumentNullException
- typeis null.
- ArgumentOutOfRangeException
- typedoes not implement IConvertible.
Add<T>(Func<T, byte[]>)
Adds the function delegate that converts an IConvertible implementation to its byte[] equivalent to the specified T.
public ConvertibleConverterDictionary Add<T>(Func<T, byte[]> converter) where T : IConvertibleParameters
- converterFunc<T, byte[]>
- The function delegate that converts an IConvertible implementation to its byte[] equivalent. 
Returns
- ConvertibleConverterDictionary
- An ConvertibleConverterDictionary that can be used to further configure other converters. 
Type Parameters
- T
- The type that implements IConvertible. 
Exceptions
- TypeArgumentOutOfRangeException
- Tdoes not implement IConvertible.
ContainsKey(Type)
Determines whether the dictionary contains an element that has the specified key.
public bool ContainsKey(Type key)Parameters
- keyType
- The key to locate. 
Returns
- bool
- trueif the dictionary contains an element that has the specified key; otherwise,- false.
GetEnumerator()
Returns an enumerator that iterates through the collection.
public IEnumerator<KeyValuePair<Type, Func<IConvertible, byte[]>>> GetEnumerator()Returns
- 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.
public bool TryGetValue(Type key, out Func<IConvertible, byte[]> value)Parameters
- keyType
- The key to locate. 
- valueFunc<IConvertible, byte[]>
- 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
- bool
- trueif the dictionary contains an element that has the specified key; otherwise,- false.
Exceptions
- ArgumentNullException
- keyis null.