Class ReadOnlyDictionary<K, T> | Unity Reflect | 1.1.0-preview.6
docs.unity.cn
    Show / Hide Table of Contents

    Class ReadOnlyDictionary<K, T>

    Polyfill for the built-in ReadOnlyDictionary type in .Net 4.6, under .Net 3.5 Should function identically to that class, except for a bit of garbage allocation

    Inheritance
    Object
    ReadOnlyDictionary<K, T>
    Namespace: Unity.Labs.Utils
    Syntax
    public class ReadOnlyDictionary<K, T> : IDictionary<K, T>, ICollection<KeyValuePair<K, T>>, IEnumerable<KeyValuePair<K, T>>, IEnumerable
    Type Parameters
    Name Description
    K

    The type of the dictionary key

    T

    The type of the dictionary value

    Constructors

    ReadOnlyDictionary(Dictionary<K, T>)

    Declaration
    public ReadOnlyDictionary(Dictionary<K, T> dictionary)
    Parameters
    Type Name Description
    Dictionary<K, T> dictionary

    Properties

    Count

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

    IsReadOnly

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

    Item[K]

    Declaration
    public T this[K key] { get; set; }
    Parameters
    Type Name Description
    K key
    Property Value
    Type Description
    T

    Keys

    Declaration
    public ICollection<K> Keys { get; }
    Property Value
    Type Description
    ICollection<K>

    Values

    Declaration
    public ICollection<T> Values { get; }
    Property Value
    Type Description
    ICollection<T>

    Methods

    Add(K, T)

    Declaration
    public void Add(K key, T value)
    Parameters
    Type Name Description
    K key
    T value

    Add(KeyValuePair<K, T>)

    Declaration
    public void Add(KeyValuePair<K, T> item)
    Parameters
    Type Name Description
    KeyValuePair<K, T> item

    Clear()

    Declaration
    public void Clear()

    Contains(KeyValuePair<K, T>)

    Declaration
    public bool Contains(KeyValuePair<K, T> item)
    Parameters
    Type Name Description
    KeyValuePair<K, T> item
    Returns
    Type Description
    Boolean

    ContainsKey(K)

    Declaration
    public bool ContainsKey(K key)
    Parameters
    Type Name Description
    K key
    Returns
    Type Description
    Boolean

    CopyTo(KeyValuePair<K, T>[], Int32)

    Declaration
    public void CopyTo(KeyValuePair<K, T>[] array, int arrayIndex)
    Parameters
    Type Name Description
    KeyValuePair<K, T>[] array
    Int32 arrayIndex

    GetEnumerator()

    Declaration
    public IEnumerator<KeyValuePair<K, T>> GetEnumerator()
    Returns
    Type Description
    IEnumerator<KeyValuePair<K, T>>

    Remove(K)

    Declaration
    public bool Remove(K key)
    Parameters
    Type Name Description
    K key
    Returns
    Type Description
    Boolean

    Remove(KeyValuePair<K, T>)

    Declaration
    public bool Remove(KeyValuePair<K, T> item)
    Parameters
    Type Name Description
    KeyValuePair<K, T> item
    Returns
    Type Description
    Boolean

    TryGetValue(K, out T)

    Declaration
    public bool TryGetValue(K key, out T value)
    Parameters
    Type Name Description
    K key
    T value
    Returns
    Type Description
    Boolean

    Extension Methods

    CollectionExtensions.Stringify<T>(ICollection<T>)
    Back to top Copyright © 2020 Unity Technologies
    Generated by DocFX