Show / Hide Table of Contents

    Interface IConfigurationDictionary<TElement>

    Represents a dictionary of values stored in a property, keyed against a string value. Use the interface for properties representing an arbitrary number of the same kind of object identified by unique string keys.

    Inherited Members
    System.Collections.Generic.IDictionary<System.String, TElement>.Add(System.String, TElement)
    System.Collections.Generic.IDictionary<System.String, TElement>.ContainsKey(System.String)
    System.Collections.Generic.IDictionary<System.String, TElement>.Remove(System.String)
    System.Collections.Generic.IDictionary<System.String, TElement>.TryGetValue(System.String, TElement)
    System.Collections.Generic.IDictionary<System.String, TElement>.Item[System.String]
    System.Collections.Generic.IDictionary<System.String, TElement>.Keys
    System.Collections.Generic.IDictionary<System.String, TElement>.Values
    System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String, TElement>>.Add(System.Collections.Generic.KeyValuePair<System.String, TElement>)
    System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String, TElement>>.Clear()
    System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String, TElement>>.Contains(System.Collections.Generic.KeyValuePair<System.String, TElement>)
    System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String, TElement>>.CopyTo(System.Collections.Generic.KeyValuePair<System.String, TElement>[], System.Int32)
    System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String, TElement>>.Remove(System.Collections.Generic.KeyValuePair<System.String, TElement>)
    System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String, TElement>>.Count
    System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String, TElement>>.IsReadOnly
    System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String, TElement>>.GetEnumerator()
    System.Collections.IEnumerable.GetEnumerator()
    System.Collections.Specialized.INotifyCollectionChanged.CollectionChanged
    IConfigurationObject.IsDirty
    IConfigurationObject.Delete()
    IConfigurationObject.Load()
    IConfigurationObject.Save()
    System.IDisposable.Dispose()
    System.ComponentModel.INotifyPropertyChanged.PropertyChanged
    Namespace: OpenCollar.Extensions.Configuration
    Assembly: OpenCollar.Extensions.Configuration.dll
    Syntax
    public interface IConfigurationDictionary<TElement> : IDictionary<string, TElement>, ICollection<KeyValuePair<string, TElement>>, IEnumerable<KeyValuePair<string, TElement>>, IEnumerable, INotifyCollectionChanged, IConfigurationObject, IDisposable, INotifyPropertyChanged
    Type Parameters
    Name Description
    TElement

    The type of the dictionary element. This must be nullable if the type is a reference type and can be null.

    Remarks

    The following UML has been generated directly from the source code using Jebbs PlantUML .

    Examples

    In the example below a property on an interface is defined as containing an arbitray number of strings.

    IConfigurationDictionary<string> Names
    {
    get; set;
    }

    If the configuration is specified in a JSON configuration file it would look something like this:

    {
    "Names": {
        "First": "Value 1",
        "Second": "Value 2",
        "Third": "Value 3"
    }
    }

    Methods

    | Improve this Doc View Source

    AddCopy(String, TElement)

    Adds a new value with the key specified, copying the properties and elements from the value give, returning the new value.

    Declaration
    TElement AddCopy(string key, TElement value)
    Parameters
    Type Name Description
    System.String key

    The key identifying the value to add.

    TElement value

    The value to copy.

    Returns
    Type Description
    TElement

    The newly added element. If this element is derived from IConfigurationObject, IConfigurationCollection<TElement> or IConfigurationDictionary<TElement>, and the object given was not created by this library, then a new object will be created and they properties and elements in the object given will be copied.

    Remarks

    Used to add objects and collections that have been constructed externally using alternate implementations.

    | Improve this Doc View Source

    AddNew(String)

    Adds a new value with the key specified, returning the new value.

    Declaration
    TElement AddNew(string key)
    Parameters
    Type Name Description
    System.String key

    The key identifying the value to add.

    Returns
    Type Description
    TElement
    Remarks

    This allows instances of the internal implementation of objects to be created and added to the collection, and returned to be populated.

    | Improve this Doc View Source

    Contains(TElement)

    Determines whether this dictionary contains the element specified.

    Declaration
    bool Contains(TElement element)
    Parameters
    Type Name Description
    TElement element

    The element for which to check.

    Returns
    Type Description
    System.Boolean

    true if the dictionary contains the specified element; otherwise, false.

    See Also

    System.Collections.Generic.IDictionary<TKey, TValue>
    System.Collections.Specialized.INotifyCollectionChanged
    IConfigurationObject
    • Improve this Doc
    • View Source
    Back to top
    Copyright © 2019-2020 Jonathan Evans
    Version: 0.2.232