Search Results for

    Show / Hide Table of Contents

    Class KeyValueCollection<TKey, TVal>

    A generic key/value collection

    Inheritance
    System.Object
    KeyValueCollection<TKey, TVal>
    RuntimeMapGroupCollection
    RuntimeMapLayerCollection
    Implements
    System.Collections.Generic.IList<TVal>
    System.Collections.Generic.ICollection<TVal>
    System.Collections.Generic.IEnumerable<TVal>
    System.Collections.IList
    System.Collections.ICollection
    System.Collections.IEnumerable
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: OSGeo.MapGuide.MaestroAPI.Mapping
    Assembly: OSGeo.MapGuide.MaestroAPI.dll
    Syntax
    public abstract class KeyValueCollection<TKey, TVal> : IList<TVal>, ICollection<TVal>, IEnumerable<TVal>, IList, ICollection, IEnumerable where TVal : class
    Type Parameters
    Name Description
    TKey

    The type of the key.

    TVal

    The type of the value.

    Constructors

    | Improve this Doc View Source

    KeyValueCollection()

    Initializes a new instance of the KeyValueCollection<TKey, TVal> class.

    Declaration
    protected KeyValueCollection()

    Fields

    | Improve this Doc View Source

    _values

    The internal list of value

    Declaration
    protected List<TVal> _values
    Field Value
    Type Description
    System.Collections.Generic.List<TVal>
    | Improve this Doc View Source

    _valuesByKey

    The internal dictionary of values keyed by its key

    Declaration
    protected Dictionary<TKey, TVal> _valuesByKey
    Field Value
    Type Description
    System.Collections.Generic.Dictionary<TKey, TVal>

    Properties

    | Improve this Doc View Source

    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 number of elements contained in the System.Collections.Generic.ICollection<T>.

    | Improve this Doc View Source

    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 the System.Collections.Generic.ICollection<T> is read-only; otherwise, false.

    | Improve this Doc View Source

    Item[TKey]

    Gets or sets the element at the specified index.

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

    The element at the specified index.

    Exceptions
    Type Condition
    System.ArgumentOutOfRangeException

    key is not a valid index in the System.Collections.Generic.IList<T>.

    System.NotSupportedException

    The property is set and the System.Collections.Generic.IList<T> is read-only.

    | Improve this Doc View Source

    Item[Int32]

    Gets or sets the element at the specified index.

    Declaration
    public virtual TVal this[int index] { get; set; }
    Parameters
    Type Name Description
    System.Int32 index
    Property Value
    Type Description
    TVal

    The element at the specified index.

    Exceptions
    Type Condition
    System.ArgumentOutOfRangeException

    index is not a valid index in the System.Collections.Generic.IList<T>.

    System.NotSupportedException

    The property is set and the System.Collections.Generic.IList<T> is read-only.

    Methods

    | Improve this Doc View Source

    Add(TVal)

    Adds an item to the System.Collections.Generic.ICollection<T>.

    Declaration
    public virtual void Add(TVal item)
    Parameters
    Type Name Description
    TVal item

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

    Exceptions
    Type Condition
    System.NotSupportedException

    The System.Collections.Generic.ICollection<T> is read-only.

    | Improve this Doc View Source

    Clear()

    Removes all items from the System.Collections.Generic.ICollection<T>.

    Declaration
    public virtual void Clear()
    Exceptions
    Type Condition
    System.NotSupportedException

    The System.Collections.Generic.ICollection<T> is read-only.

    | Improve this Doc View Source

    Contains(TVal)

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

    Declaration
    public bool Contains(TVal item)
    Parameters
    Type Name Description
    TVal 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.

    | Improve this Doc View Source

    CopyTo(TVal[], Int32)

    Copies the elements of the System.Collections.Generic.ICollection<T> to an System.Array, starting at a particular System.Array index.

    Declaration
    public void CopyTo(TVal[] array, int arrayIndex)
    Parameters
    Type Name Description
    TVal[] array

    The one-dimensional System.Array that is the destination of the elements copied from System.Collections.Generic.ICollection<T>. The System.Array must have zero-based indexing.

    System.Int32 arrayIndex

    The zero-based index in array at which copying begins.

    Exceptions
    Type Condition
    System.ArgumentNullException

    array is null.

    System.ArgumentOutOfRangeException

    arrayIndex is less than 0.

    System.ArgumentException

    array is multidimensional. -or- arrayIndex is equal to or greater than the length of array. -or- The number of elements in the source System.Collections.Generic.ICollection<T> is greater than the available space from arrayIndex to the end of the destination array. -or- Type TVal cannot be cast automatically to the type of the destination array.

    | Improve this Doc View Source

    GetEnumerator()

    Returns an enumerator that iterates through the collection.

    Declaration
    public IEnumerator<TVal> GetEnumerator()
    Returns
    Type Description
    System.Collections.Generic.IEnumerator<TVal>

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

    | Improve this Doc View Source

    IndexOf(TKey)

    Determines the index of a specific key in the collection

    Declaration
    public int IndexOf(TKey key)
    Parameters
    Type Name Description
    TKey key

    The key of the object to locate in the collection

    Returns
    Type Description
    System.Int32

    The index of key if found in the list; otherwise, -1.

    | Improve this Doc View Source

    IndexOf(TVal)

    Determines the index of a specific item in the System.Collections.Generic.IList<T>.

    Declaration
    public int IndexOf(TVal item)
    Parameters
    Type Name Description
    TVal item

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

    Returns
    Type Description
    System.Int32

    The index of item if found in the list; otherwise, -1.

    | Improve this Doc View Source

    Insert(Int32, TVal)

    Inserts an item to the System.Collections.Generic.IList<T> at the specified index.

    Declaration
    public virtual void Insert(int index, TVal item)
    Parameters
    Type Name Description
    System.Int32 index

    The zero-based index at which item should be inserted.

    TVal item

    The object to insert into the System.Collections.Generic.IList<T>.

    Exceptions
    Type Condition
    System.ArgumentOutOfRangeException

    index is not a valid index in the System.Collections.Generic.IList<T>.

    System.NotSupportedException

    The System.Collections.Generic.IList<T> is read-only.

    | Improve this Doc View Source

    OnBeforeItemAdded(TVal)

    Called before an item is added

    Declaration
    protected virtual void OnBeforeItemAdded(TVal item)
    Parameters
    Type Name Description
    TVal item

    The item.

    | Improve this Doc View Source

    OnBeforeItemRemove(TVal)

    Called before an item is removed

    Declaration
    protected virtual void OnBeforeItemRemove(TVal item)
    Parameters
    Type Name Description
    TVal item

    The item.

    | Improve this Doc View Source

    OnCollectionChanged()

    Raises the CollectionChanged event

    Declaration
    protected virtual void OnCollectionChanged()
    | Improve this Doc View Source

    OnItemAdded(TVal)

    Called after an item has been added

    Declaration
    protected abstract void OnItemAdded(TVal item)
    Parameters
    Type Name Description
    TVal item

    The item.

    | Improve this Doc View Source

    OnItemRemoved(TVal)

    Called after an item has been removed. Note this is only called if the remove operation removed the item in question

    Declaration
    protected abstract void OnItemRemoved(TVal value)
    Parameters
    Type Name Description
    TVal value

    The value.

    | Improve this Doc View Source

    Remove(TVal)

    Removes the first occurrence of a specific object from the System.Collections.Generic.ICollection<T>.

    Declaration
    public bool Remove(TVal item)
    Parameters
    Type Name Description
    TVal item

    The object to remove from the System.Collections.Generic.ICollection<T>.

    Returns
    Type Description
    System.Boolean

    true if item was successfully removed from the System.Collections.Generic.ICollection<T>; otherwise, false. This method also returns false if item is not found in the original System.Collections.Generic.ICollection<T>.

    Exceptions
    Type Condition
    System.NotSupportedException

    The System.Collections.Generic.ICollection<T> is read-only.

    | Improve this Doc View Source

    RemoveAt(Int32)

    Removes the System.Collections.Generic.IList<T> item at the specified index.

    Declaration
    public void RemoveAt(int index)
    Parameters
    Type Name Description
    System.Int32 index

    The zero-based index of the item to remove.

    Exceptions
    Type Condition
    System.ArgumentOutOfRangeException

    index is not a valid index in the System.Collections.Generic.IList<T>.

    System.NotSupportedException

    The System.Collections.Generic.IList<T> is read-only.

    | Improve this Doc View Source

    SelectKey(TVal)

    Selects the key given the value.

    Declaration
    protected abstract TKey SelectKey(TVal value)
    Parameters
    Type Name Description
    TVal value

    The value.

    Returns
    Type Description
    TKey
    | Improve this Doc View Source

    SetNewIndex(Int32, TVal)

    Sets the new index of the specified object. This object must already be present inside the collection

    Declaration
    public void SetNewIndex(int newIndex, TVal item)
    Parameters
    Type Name Description
    System.Int32 newIndex
    TVal item

    Events

    | Improve this Doc View Source

    CollectionChanged

    Raised when the collection has been modified

    Declaration
    public event EventHandler CollectionChanged
    Event Type
    Type Description
    System.EventHandler

    Explicit Interface Implementations

    | Improve this Doc View Source

    ICollection.CopyTo(Array, Int32)

    Declaration
    void ICollection.CopyTo(Array array, int index)
    Parameters
    Type Name Description
    System.Array array
    System.Int32 index
    | Improve this Doc View Source

    ICollection.Count

    Declaration
    int ICollection.Count { get; }
    Returns
    Type Description
    System.Int32
    | Improve this Doc View Source

    ICollection.IsSynchronized

    Declaration
    bool ICollection.IsSynchronized { get; }
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    ICollection.SyncRoot

    Declaration
    object ICollection.SyncRoot { get; }
    Returns
    Type Description
    System.Object
    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    IList.Add(Object)

    Declaration
    int IList.Add(object value)
    Parameters
    Type Name Description
    System.Object value
    Returns
    Type Description
    System.Int32
    | Improve this Doc View Source

    IList.Clear()

    Declaration
    void IList.Clear()
    | Improve this Doc View Source

    IList.Contains(Object)

    Declaration
    bool IList.Contains(object value)
    Parameters
    Type Name Description
    System.Object value
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IList.IndexOf(Object)

    Declaration
    int IList.IndexOf(object value)
    Parameters
    Type Name Description
    System.Object value
    Returns
    Type Description
    System.Int32
    | Improve this Doc View Source

    IList.Insert(Int32, Object)

    Declaration
    void IList.Insert(int index, object value)
    Parameters
    Type Name Description
    System.Int32 index
    System.Object value
    | Improve this Doc View Source

    IList.IsFixedSize

    Declaration
    bool IList.IsFixedSize { get; }
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IList.IsReadOnly

    Declaration
    bool IList.IsReadOnly { get; }
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IList.Item[Int32]

    Declaration
    object IList.this[int index] { get; set; }
    Parameters
    Type Name Description
    System.Int32 index
    Returns
    Type Description
    System.Object
    | Improve this Doc View Source

    IList.Remove(Object)

    Declaration
    void IList.Remove(object value)
    Parameters
    Type Name Description
    System.Object value
    | Improve this Doc View Source

    IList.RemoveAt(Int32)

    Declaration
    void IList.RemoveAt(int index)
    Parameters
    Type Name Description
    System.Int32 index

    Implements

    System.Collections.Generic.IList<T>
    System.Collections.Generic.ICollection<T>
    System.Collections.Generic.IEnumerable<T>
    System.Collections.IList
    System.Collections.ICollection
    System.Collections.IEnumerable
    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright © 2009 - 2022 Jackie Ng