Search Results for

    Show / Hide Table of Contents

    Class Map

    A ordered map of System.String to Value for serialization by an IConfigProvider. Use Map() or From(IDictionary<String, Value>) to create.

    Inheritance
    System.Object
    Value
    Map
    Implements
    System.Collections.Generic.IDictionary<System.String, Value>
    System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String, Value>>
    System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String, Value>>
    System.Collections.IEnumerable
    Inherited Members
    Value.Null()
    Value.List()
    Value.Map()
    Value.From(String)
    Value.Text(String)
    Value.From(Int64)
    Value.Integer(Int64)
    Value.From(Decimal)
    Value.Float(Decimal)
    Value.From(Boolean)
    Value.Bool(Boolean)
    Value.From(IEnumerable<Value>)
    Value.From(IDictionary<String, Value>)
    Value.From(IEnumerable<KeyValuePair<String, Value>>)
    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: IPA.Config.Data
    Assembly: IPA.Loader.dll
    Syntax
    public sealed class Map : Value, IDictionary<string, Value>, ICollection<KeyValuePair<string, Value>>, IEnumerable<KeyValuePair<string, Value>>, IEnumerable

    Properties

    | Improve this Doc View Source

    Count

    Gets the number of key-value pairs in this Map.

    Declaration
    public int Count { get; }
    Property Value
    Type Description
    System.Int32
    See Also
    System.Collections.Generic.ICollection<T>.Count
    | Improve this Doc View Source

    Item[String]

    Accesses the Value at key in the map.

    Declaration
    public Value this[string key] { get; set; }
    Parameters
    Type Name Description
    System.String key

    the key to get the value associated with

    Property Value
    Type Description
    Value

    the value associated with the key

    See Also
    System.Collections.Generic.IDictionary<TKey, TValue>.Item[TKey]
    | Improve this Doc View Source

    Keys

    Gets a collection of the keys for the Map.

    Declaration
    public ICollection<string> Keys { get; }
    Property Value
    Type Description
    System.Collections.Generic.ICollection<System.String>
    See Also
    System.Collections.Generic.IDictionary<TKey, TValue>.Keys
    | Improve this Doc View Source

    Values

    Gets a collection of the values in the Map.

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

    Unlike all other iterables given by Map, this does not guarantee that order is maintained.

    See Also
    System.Collections.Generic.IDictionary<TKey, TValue>.Values

    Methods

    | Improve this Doc View Source

    Add(String, Value)

    Adds a new Value with a given key.

    Declaration
    public void Add(string key, Value value)
    Parameters
    Type Name Description
    System.String key

    the key to put the value at

    Value value

    the Value to add

    See Also
    System.Collections.Generic.IDictionary<TKey, TValue>.Add(TKey, TValue)
    | Improve this Doc View Source

    Clear()

    Clears the Map of its key-value pairs.

    Declaration
    public void Clear()
    See Also
    System.Collections.Generic.ICollection<T>.Clear()
    | Improve this Doc View Source

    ContainsKey(String)

    Checks if the Map contains a given key.

    Declaration
    public bool ContainsKey(string key)
    Parameters
    Type Name Description
    System.String key

    the key to check for

    Returns
    Type Description
    System.Boolean true if the key exists, otherwise false
    See Also
    System.Collections.Generic.IDictionary<TKey, TValue>.ContainsKey(TKey)
    | Improve this Doc View Source

    GetEnumerator()

    Enumerates the Map's key-value pairs.

    Declaration
    public IEnumerator<KeyValuePair<string, Value>> GetEnumerator()
    Returns
    Type Description
    System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<System.String, Value>>

    an System.Collections.Generic.IEnumerator<T> of key-value pairs in this Map

    See Also
    System.Collections.Generic.IEnumerable<T>.GetEnumerator()
    | Improve this Doc View Source

    Remove(String)

    Removes the object associated with a key in this Map.

    Declaration
    public bool Remove(string key)
    Parameters
    Type Name Description
    System.String key

    the key to remove

    Returns
    Type Description
    System.Boolean

    true if the key existed, false otherwise

    See Also
    System.Collections.Generic.IDictionary<TKey, TValue>.Remove(TKey)
    | Improve this Doc View Source

    ToString()

    Converts this Value into a human-readable format.

    Declaration
    public override string ToString()
    Returns
    Type Description
    System.String

    a JSON-like set of key-value pairs

    Overrides
    Value.ToString()
    | Improve this Doc View Source

    TryGetValue(String, out Value)

    Gets the value associated with the specified key.

    Declaration
    public bool TryGetValue(string key, out Value value)
    Parameters
    Type Name Description
    System.String key

    the key of the value to get

    Value value

    the target location of the retrieved object

    Returns
    Type Description
    System.Boolean

    true if the key was found and value set, false otherwise

    See Also
    System.Collections.Generic.IDictionary<TKey, TValue>.TryGetValue(TKey, TValue)

    Explicit Interface Implementations

    | Improve this Doc View Source

    ICollection<KeyValuePair<String, Value>>.Add(KeyValuePair<String, Value>)

    Declaration
    void ICollection<KeyValuePair<string, Value>>.Add(KeyValuePair<string, Value> item)
    Parameters
    Type Name Description
    System.Collections.Generic.KeyValuePair<System.String, Value> item
    | Improve this Doc View Source

    ICollection<KeyValuePair<String, Value>>.Contains(KeyValuePair<String, Value>)

    Declaration
    bool ICollection<KeyValuePair<string, Value>>.Contains(KeyValuePair<string, Value> item)
    Parameters
    Type Name Description
    System.Collections.Generic.KeyValuePair<System.String, Value> item
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    ICollection<KeyValuePair<String, Value>>.CopyTo(KeyValuePair<String, Value>[], Int32)

    Declaration
    void ICollection<KeyValuePair<string, Value>>.CopyTo(KeyValuePair<string, Value>[] array, int arrayIndex)
    Parameters
    Type Name Description
    System.Collections.Generic.KeyValuePair<System.String, Value>[] array
    System.Int32 arrayIndex
    | Improve this Doc View Source

    ICollection<KeyValuePair<String, Value>>.IsReadOnly

    Declaration
    bool ICollection<KeyValuePair<string, Value>>.IsReadOnly { get; }
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    ICollection<KeyValuePair<String, Value>>.Remove(KeyValuePair<String, Value>)

    Declaration
    bool ICollection<KeyValuePair<string, Value>>.Remove(KeyValuePair<string, Value> item)
    Parameters
    Type Name Description
    System.Collections.Generic.KeyValuePair<System.String, Value> item
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IEnumerable.GetEnumerator()

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

    Implements

    System.Collections.Generic.IDictionary<TKey, TValue>
    System.Collections.Generic.ICollection<T>
    System.Collections.Generic.IEnumerable<T>
    System.Collections.IEnumerable

    Extension Methods

    EnumerableExtensions.NonNull<T, U>(IEnumerable<T>, Func<T, U>)
    EnumerableExtensions.NonNull<T, U>(IEnumerable<T>, Func<T, Nullable<U>>)
    ReflectionUtil.SetField<T, U>(T, String, U)
    ReflectionUtil.GetField<U, T>(T, String)
    ReflectionUtil.SetProperty<T, U>(T, String, U)
    ReflectionUtil.GetProperty<U, T>(T, String)
    ReflectionUtil.InvokeMethod<U, T>(T, String, Object[])
    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX