Xamarin.Android

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class TypedSortedListEx<TKey, TValue>

    Show / Hide Table of Contents

    Class TypedSortedListEx<TKey, TValue>

    Represents the sort options for the list.

    Inheritance
    System.Object
    TypedSortedListEx<TKey, TValue>
    DocIOSortedList<TKey, TValue>
    SortedDictionary<TKey, TValue>
    Implements
    System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey, TValue>>
    System.Collections.IEnumerable
    System.Collections.Generic.IDictionary<TKey, TValue>
    System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey, TValue>>
    System.Collections.IDictionary
    System.Collections.ICollection
    Namespace: Syncfusion.DocIO.DLS
    Assembly: Syncfusion.DocIO.Portable.dll
    Syntax
    public class TypedSortedListEx<TKey, TValue> : Object, IEnumerable<KeyValuePair<TKey, TValue>>, IEnumerable, IDictionary<TKey, TValue>, ICollection<KeyValuePair<TKey, TValue>>, IDictionary, ICollection where TKey : IComparable
    Type Parameters
    Name Description
    TKey
    TValue

    Constructors

    TypedSortedListEx()

    Default constructor.

    Declaration
    public TypedSortedListEx()

    TypedSortedListEx(IComparer<TKey>)

    Creates an empty SortedList with the default initial capacity and specified comparer.

    Declaration
    public TypedSortedListEx(IComparer<TKey> comparer)
    Parameters
    Type Name Description
    System.Collections.Generic.IComparer<TKey> comparer

    The IComparer is used to determine whether two keys are equal.

    TypedSortedListEx(IComparer<TKey>, Int32)

    Creates an empty SortedList with the specified initial capacity and specified comparer.

    Declaration
    public TypedSortedListEx(IComparer<TKey> comparer, int capacity)
    Parameters
    Type Name Description
    System.Collections.Generic.IComparer<TKey> comparer

    Initial capacity.

    System.Int32 capacity

    The IComparer is used to determine whether two keys are equal.

    TypedSortedListEx(IDictionary<TKey, TValue>)

    Copies the elements from the specified dictionary to a new list with the same initial capacity as the number of elements copied.

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

    The IDictionary to copy.

    TypedSortedListEx(IDictionary<TKey, TValue>, IComparer<TKey>)

    Copies the elements from the specified dictionary to a new list with the same initial capacity as the number of elements copied and with the specified comparer.

    Declaration
    public TypedSortedListEx(IDictionary<TKey, TValue> d, IComparer<TKey> comparer)
    Parameters
    Type Name Description
    System.Collections.Generic.IDictionary<TKey, TValue> d

    The IDictionary to copy.

    System.Collections.Generic.IComparer<TKey> comparer

    The IComparer to use to determine whether two keys are equal.

    Exceptions
    Type Condition
    System.ArgumentNullException

    When argument d is null.

    TypedSortedListEx(Int32)

    Creates an empty list with the specified initial capacity.

    Declaration
    public TypedSortedListEx(int initialCapacity)
    Parameters
    Type Name Description
    System.Int32 initialCapacity

    Initial capacity.

    Exceptions
    Type Condition
    System.ArgumentOutOfRangeException

    When initialCapacity is less than zero.

    Properties

    Capacity

    Capacity of internal buffers.

    Declaration
    public virtual int Capacity { get; set; }
    Property Value
    Type Description
    System.Int32

    Count

    Size of the collection. Read-only.

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

    IsFixedSize

    Returns True if collection has fixed size, False otherwise.

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

    IsReadOnly

    Returns True if list is readonly, False otherwise. Read-only.

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

    IsSynchronized

    Returns True if the collection is synchronized, False otherwise.

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

    Item[TKey]

    Gets or sets the value associated with the specified key.

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

    Item[Object]

    Gets or sets the value for the property with specified key.

    Declaration
    public object this[object key] { get; set; }
    Parameters
    Type Name Description
    System.Object key

    The key for the property.

    Property Value
    Type Description
    System.Object

    An object with the specific key.

    Keys

    List of keys. Read-only.

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

    SyncRoot

    Returns the object that can be used to synchronize access to the collection. Read-only.

    Declaration
    public virtual object SyncRoot { get; }
    Property Value
    Type Description
    System.Object

    Values

    List of values. Read-only.

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

    Methods

    Add(TKey, TValue)

    Adds an element with the provided key and value to the list.

    Declaration
    public virtual void Add(TKey key, TValue value)
    Parameters
    Type Name Description
    TKey key

    The Object to use as the key of the element to add.

    TValue value

    The Object to use as the value of the element to add.

    Exceptions
    Type Condition
    System.ArgumentNullException

    When key is null.

    System.ArgumentException

    When list already contains specified key.

    Add(KeyValuePair<TKey, TValue>)

    Adds an item to the .

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

    The object to add to the .

    Add(Object, Object)

    Adds an element with the provided key and value to the System.Collections.IDictionary object.

    Declaration
    public void Add(object key, object value)
    Parameters
    Type Name Description
    System.Object key

    The System.Object to use as the key of the element to add.

    System.Object value

    The System.Object to use as the value of the element to add.

    Clear()

    Removes all elements from the collection.

    Declaration
    public virtual void Clear()

    Clone()

    Creates a new object that is a copy of the current instance.

    Declaration
    public virtual object Clone()
    Returns
    Type Description
    System.Object

    Copy of the current instance.

    CloneAll()

    Clone current instance.

    Declaration
    public TypedSortedListEx<TKey, TValue> CloneAll()
    Returns
    Type Description
    TypedSortedListEx<TKey, TValue>

    Returns clone of current object.

    Contains(TKey)

    Determines whether the list contains an element with the specified key.

    Declaration
    public virtual bool Contains(TKey key)
    Parameters
    Type Name Description
    TKey key

    Key of the element to search.

    Returns
    Type Description
    System.Boolean

    True if list contains specified key.

    Contains(KeyValuePair<TKey, TValue>)

    Determines whether the 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 .

    Returns
    Type Description
    System.Boolean

    true if item is found in the ; otherwise, false.

    Contains(Object)

    Determines whether the System.Collections.IDictionary object contains an element with the specified key.

    Declaration
    public bool Contains(object key)
    Parameters
    Type Name Description
    System.Object key

    The key to locate in the System.Collections.IDictionary object.

    Returns
    Type Description
    System.Boolean

    true if the System.Collections.IDictionary contains an element with the key; otherwise, false.

    ContainsKey(TKey)

    Determines whether the list contains an element with the specified key.

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

    Key of the element to search.

    Returns
    Type Description
    System.Boolean

    True if list contains specified key.

    ContainsValue(TValue)

    Determines whether the list contains the specified value.

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

    Value of the element to search.

    Returns
    Type Description
    System.Boolean

    True if list contains specified value.

    CopyTo(Array, Int32)

    Copies all the elements of the SortedListEx to the specified one-dimensional Array starting at the specified destination Array index.

    Declaration
    public virtual void CopyTo(Array array, int arrayIndex)
    Parameters
    Type Name Description
    System.Array array

    The one-dimensional Array that is the destination of the elements copied from the current list.

    System.Int32 arrayIndex

    The index in array at which copying begins.

    Exceptions
    Type Condition
    System.ArgumentNullException

    If specified array is null.

    System.ArgumentException

    If rank of the array is not 1 or there are not enough elements.

    System.ArgumentOutOfRangeException

    If specified arrayIndex is less than zero.

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

    Copies the elements of the to an System.Array, starting at a particular System.Array index.

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

    The one-dimensional System.Array that is the destination of the elements copied from . The System.Array must have zero-based indexing.

    System.Int32 arrayIndex

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

    GetByIndex(Int32)

    Gets the value at the specified index of the SortedListEx.

    Declaration
    public virtual TValue GetByIndex(int index)
    Parameters
    Type Name Description
    System.Int32 index

    The zero-based index of the value to get.

    Returns
    Type Description
    TValue

    The value at the specified index of the SortedListEx.

    Exceptions
    Type Condition
    System.ArgumentOutOfRangeException

    When index is less than zero or greater than size of the list.

    GetEnumerator()

    Returns an IEnumerator that can iterate through the SortedListEx.

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

    An IEnumerator for the SortedListEx.

    GetKey(Int32)

    Gets the key at the specified index of the SortedListEx.

    Declaration
    public virtual TKey GetKey(int index)
    Parameters
    Type Name Description
    System.Int32 index

    The zero-based index of the key to get.

    Returns
    Type Description
    TKey

    The key at the specified index of the SortedListEx.

    Exceptions
    Type Condition
    System.ArgumentOutOfRangeException

    When index is less than zero or greater than size of the list.

    GetKeyList()

    Gets the keys in the SortedListEx.

    Declaration
    public virtual IList<TKey> GetKeyList()
    Returns
    Type Description
    System.Collections.Generic.IList<TKey>

    An IList containing the keys in the SortedListEx.

    GetValueList()

    Gets the values in the SortedListEx.

    Declaration
    public virtual IList<TValue> GetValueList()
    Returns
    Type Description
    System.Collections.Generic.IList<TValue>

    An IList containing the values in the SortedListEx.

    IndexOfKey(TKey)

    Returns the zero-based index of the specified key.

    Declaration
    public virtual int IndexOfKey(TKey key)
    Parameters
    Type Name Description
    TKey key

    The key to locate.

    Returns
    Type Description
    System.Int32

    The zero-based index of key, if key is found; otherwise, -1.

    Exceptions
    Type Condition
    System.ArgumentNullException

    If specified key is null.

    IndexOfValue(TValue)

    Returns the zero-based index of the first occurrence of the specified value.

    Declaration
    public virtual int IndexOfValue(TValue value)
    Parameters
    Type Name Description
    TValue value

    The value to locate (can be NULL).

    Returns
    Type Description
    System.Int32

    The zero-based index of the first occurrence of value, if value is found; otherwise, -1.

    Remove(TKey)

    Removes the element with the specified key from SortedListEx.

    Declaration
    public virtual bool Remove(TKey key)
    Parameters
    Type Name Description
    TKey key

    The key of the element to remove.

    Returns
    Type Description
    System.Boolean

    Remove(KeyValuePair<TKey, TValue>)

    Removes the first occurrence of a specific object from the .

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

    The object to remove from the .

    Returns
    Type Description
    System.Boolean

    true if item was successfully removed from the ; otherwise, false. This method also returns false if item is not found in the original .

    Remove(Object)

    Removes the element with the specified key from the System.Collections.IDictionary object.

    Declaration
    public void Remove(object key)
    Parameters
    Type Name Description
    System.Object key

    The key of the element to remove.

    RemoveAt(Int32)

    Removes the element at the specified index.

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

    The zero-based index of the element to remove.

    Exceptions
    Type Condition
    System.ArgumentOutOfRangeException

    When index is less than zero or greater than size of the list.

    SetByIndex(Int32, TValue)

    Replaces the value at the specific index.

    Declaration
    public virtual void SetByIndex(int index, TValue value)
    Parameters
    Type Name Description
    System.Int32 index

    The zero-based index at which to save value.

    TValue value

    The Object to save into. Can be NULL.

    Exceptions
    Type Condition
    System.ArgumentOutOfRangeException

    When index is less than zero or greater than size of the list.

    Synchronized(TypedSortedListEx<TKey, TValue>)

    Returns a synchronized (thread-safe) wrapper for the SortedList.

    Declaration
    public static TypedSortedListEx<TKey, TValue> Synchronized(TypedSortedListEx<TKey, TValue> list)
    Parameters
    Type Name Description
    TypedSortedListEx<TKey, TValue> list

    The SortedList to synchronize.

    Returns
    Type Description
    TypedSortedListEx<TKey, TValue>

    A synchronized (thread-safe) wrapper for the SortedList.

    Exceptions
    Type Condition
    System.ArgumentNullException

    When list is null.

    TrimToSize()

    Sets the capacity to the actual number of elements.

    Declaration
    public virtual void TrimToSize()

    TryGetValue(TKey, out TValue)

    Returns the value associated with the specified key.

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

    Implements

    System.Collections.Generic.IEnumerable<>
    System.Collections.IEnumerable
    System.Collections.Generic.IDictionary<, >
    System.Collections.Generic.ICollection<>
    System.Collections.IDictionary
    System.Collections.ICollection
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved