Table of Contents

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

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.

public Func<IConvertible, byte[]> this[Type type] { get; }

Parameters

type Type

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

type Type

The type that implements IConvertible.

converter Func<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

type is null.

ArgumentOutOfRangeException

type does 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 : IConvertible

Parameters

converter Func<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

T does not implement IConvertible.

ContainsKey(Type)

Determines whether the dictionary contains an element that has the specified key.

public bool ContainsKey(Type key)

Parameters

key Type

The key to locate.

Returns

Boolean

true if 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

key Type

The key to locate.

value Func<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

Boolean

true if the dictionary contains an element that has the specified key; otherwise, false.

Exceptions

ArgumentNullException

key is null.

Explicit Interface Implementations

IEnumerable.GetEnumerator()

IEnumerator IEnumerable.GetEnumerator()

Returns

IEnumerator