Table of Contents

Class AbstractErrorHandledNamedValues<T>

Namespace
Tlabs.JobCntrl
Assembly
Tlabs.JobCntrl.dll

Dictionary of NamedValues<T> that provides abstracts method to handle errors.

public abstract class AbstractErrorHandledNamedValues<T> : IDictionary<string, T>, ICollection<KeyValuePair<string, T>>, IReadOnlyDictionary<string, T>, IReadOnlyCollection<KeyValuePair<string, T>>, IEnumerable<KeyValuePair<string, T>>, IEnumerable

Type Parameters

T

Type parameter for the contained named values

Inheritance
AbstractErrorHandledNamedValues<T>
Implements
Derived
Inherited Members
Extension Methods

Constructors

AbstractErrorHandledNamedValues()

Default ctor

public AbstractErrorHandledNamedValues()

AbstractErrorHandledNamedValues(IEnumerable<KeyValuePair<string, T>>)

Ctor to intialize from another properties dictionary.

public AbstractErrorHandledNamedValues(IEnumerable<KeyValuePair<string, T>> other)

Parameters

other IEnumerable<KeyValuePair<string, T>>

AbstractErrorHandledNamedValues(int)

Ctor from capacity

public AbstractErrorHandledNamedValues(int capacity)

Parameters

capacity int

Properties

Count

public int Count { get; }

Property Value

int

IsReadOnly

public bool IsReadOnly { get; }

Property Value

bool

this[string]

public T this[string key] { get; set; }

Parameters

key string

Property Value

T

Keys

public ICollection<string> Keys { get; }

Property Value

ICollection<string>

Values

public ICollection<T> Values { get; }

Property Value

ICollection<T>

Methods

Add(string, T)

public void Add(string key, T value)

Parameters

key string
value T

AsReadonly()

Retuns a read-only version of this dctionary.

public IReadOnlyDictionary<string, T> AsReadonly()

Returns

IReadOnlyDictionary<string, T>

Clear()

public void Clear()

Contains(KeyValuePair<string, T>)

public bool Contains(KeyValuePair<string, T> item)

Parameters

item KeyValuePair<string, T>

Returns

bool

ContainsKey(string)

public bool ContainsKey(string key)

Parameters

key string

Returns

bool

CopyTo(KeyValuePair<string, T>[], int)

public void CopyTo(KeyValuePair<string, T>[] array, int arrayIndex)

Parameters

array KeyValuePair<string, T>[]
arrayIndex int

GetEnumerator()

public IEnumerator<KeyValuePair<string, T>> GetEnumerator()

Returns

IEnumerator<KeyValuePair<string, T>>

HandleDuplicateKey(string, T)

Error handler method called on an attempt to add a duplicate key.

protected abstract void HandleDuplicateKey(string key, T newValue)

Parameters

key string
newValue T

Remarks

Implementation could set the newValue to the existing key or even throw their own exception.

HandleKeyNotFound(string)

Error handler method called on key-not-found errors.

protected abstract T HandleKeyNotFound(string key)

Parameters

key string

Returns

T

Remarks

Implementation could return a special value or even throw their own exception.

Remove(KeyValuePair<string, T>)

public bool Remove(KeyValuePair<string, T> item)

Parameters

item KeyValuePair<string, T>

Returns

bool

Remove(string)

public bool Remove(string key)

Parameters

key string

Returns

bool

TryGetValue(string, out T)

public bool TryGetValue(string key, out T value)

Parameters

key string
value T

Returns

bool

Explicit Interface Implementations

ICollection<KeyValuePair<string, T>>.Add(KeyValuePair<string, T>)

void ICollection<KeyValuePair<string, T>>.Add(KeyValuePair<string, T> item)

Parameters

item KeyValuePair<string, T>

IReadOnlyDictionary<string, T>.Keys

IEnumerable<string> IReadOnlyDictionary<string, T>.Keys { get; }

Returns

IEnumerable<string>

IReadOnlyDictionary<string, T>.Values

IEnumerable<T> IReadOnlyDictionary<string, T>.Values { get; }

Returns

IEnumerable<T>

IEnumerable.GetEnumerator()

IEnumerator IEnumerable.GetEnumerator()

Returns

IEnumerator