Show / Hide Table of Contents

Class ReadOnlyDictionary<TKey, TValue>

Class ReadOnlyDictionary

Inheritance
System.Object
ReadOnlyDictionary<TKey, TValue>
ConnectionCollection
Implements
System.Collections.Generic.IReadOnlyDictionary<TKey, TValue>
System.Collections.Generic.IReadOnlyCollection<System.Collections.Generic.KeyValuePair<TKey, TValue>>
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey, TValue>>
System.Collections.IEnumerable
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Experior.Interfaces.Collections
Assembly: Experior.Interfaces.dll
Syntax
public class ReadOnlyDictionary<TKey, TValue> : IReadOnlyDictionary<TKey, TValue>, IReadOnlyCollection<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>, IEnumerable
Type Parameters
Name Description
TKey

The type of the T key.

TValue

The type of the T value.

Constructors

ReadOnlyDictionary(IDictionary<TKey, TValue>)

Declaration
public ReadOnlyDictionary(IDictionary<TKey, TValue> source)
Parameters
Type Name Description
System.Collections.Generic.IDictionary<TKey, TValue> source

ReadOnlyDictionary(Int32)

Declaration
public ReadOnlyDictionary(int capacity = 0)
Parameters
Type Name Description
System.Int32 capacity

Fields

Dictionary

The _dictionary

Declaration
protected IDictionary<TKey, TValue> Dictionary
Field Value
Type Description
System.Collections.Generic.IDictionary<TKey, TValue>

Properties

Count

Gets the number of elements contained in the System.Collections.Generic.ICollection<T>.

Declaration
public int Count { get; }
Property Value
Type Description
System.Int32

The count.

IsReadOnly

Gets a value indicating whether the System.Collections.Generic.ICollection<T> is read-only.

Declaration
public bool IsReadOnly { get; }
Property Value
Type Description
System.Boolean

true if this instance is read only; otherwise, false.

Item[TKey]

Gets or sets the element with the specified key.

Declaration
public TValue this[TKey key] { get; }
Parameters
Type Name Description
TKey key

The key.

Property Value
Type Description
TValue

[ERROR: invalid expression ReturnTypeName.FullName].

Keys

Declaration
public IEnumerable<TKey> Keys { get; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<TKey>

Values

Declaration
public IEnumerable<TValue> Values { get; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<TValue>

Methods

Contains(KeyValuePair<TKey, TValue>)

Determines whether the System.Collections.Generic.ICollection<T> contains a specific value.

Declaration
public bool Contains(KeyValuePair<TKey, TValue> item)
Parameters
Type Name Description
System.Collections.Generic.KeyValuePair<TKey, TValue> item

The object to locate in the System.Collections.Generic.ICollection<T>.

Returns
Type Description
System.Boolean

true if item is found in the System.Collections.Generic.ICollection<T>; otherwise, false.

ContainsKey(TKey)

Determines whether the System.Collections.Generic.IDictionary<TKey, TValue> contains an element with the specified key.

Declaration
public bool ContainsKey(TKey key)
Parameters
Type Name Description
TKey key

The key to locate in the System.Collections.Generic.IDictionary<TKey, TValue>.

Returns
Type Description
System.Boolean

true if the System.Collections.Generic.IDictionary<TKey, TValue> contains an element with the key; otherwise, false.

ContainsValue(TValue)

Determines whether the specified value contains value.

Declaration
public bool ContainsValue(TValue value)
Parameters
Type Name Description
TValue value

The value.

Returns
Type Description
System.Boolean

true if the specified value contains value; otherwise, false.

CopyTo(KeyValuePair<TKey, TValue>[], Int32)

Copies to.

Declaration
public void CopyTo(KeyValuePair<TKey, TValue>[] array, int arrayIndex)
Parameters
Type Name Description
System.Collections.Generic.KeyValuePair<TKey, TValue>[] array

The array.

System.Int32 arrayIndex

Index of the array.

GetEnumerator()

Returns an enumerator that iterates through the collection.

Declaration
public IEnumerator<KeyValuePair<TKey, TValue>> GetEnumerator()
Returns
Type Description
System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<TKey, TValue>>

A System.Collections.Generic.IEnumerator<T> that can be used to iterate through the collection.

TryGetValue(TKey, out TValue)

Tries the get value.

Declaration
public bool TryGetValue(TKey key, out TValue value)
Parameters
Type Name Description
TKey key

The key.

TValue value

The value.

Returns
Type Description
System.Boolean

true if XXXX, false otherwise

Explicit Interface Implementations

IEnumerable.GetEnumerator()

Returns an enumerator that iterates through a collection.

Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type Description
System.Collections.IEnumerator

An System.Collections.IEnumerator object that can be used to iterate through the collection.

Implements

System.Collections.Generic.IReadOnlyDictionary<TKey, TValue>
System.Collections.Generic.IReadOnlyCollection<T>
System.Collections.Generic.IEnumerable<T>
System.Collections.IEnumerable
Back to top Generated by DocFX