Class TypedDictionaryBase
Provides the abstract base class for a strongly typed collection of key-and-value pairs.
Implements
Inherited Members
Namespace: Syncfusion.Collections
Assembly: Syncfusion.Shared.Base.dll
Syntax
public abstract class TypedDictionaryBase : IDictionary, ICollection, IEnumerable
Remarks
This class is very similar to the System.Collections.DictionaryBase class. The main difference is that this version allows you to set the InnerHashtable. System.Collections.DictionaryBase only provides a Read-only property for the InnerHashtable.
Constructors
TypedDictionaryBase()
Initializes a new TypedDictionaryBase.
Declaration
protected TypedDictionaryBase()
TypedDictionaryBase(Hashtable)
Initializes a new TypedDictionaryBase and associates it with a System.Collections.Hashtable.
Declaration
protected TypedDictionaryBase(Hashtable hashtable)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Hashtable | hashtable | The inner collection that will hold entries of this collection. |
Properties
Count
Removes the number of elements contained in the TypedDictionaryBase instance.
Declaration
public int Count { get; }
Property Value
Type |
---|
System.Int32 |
Dictionary
Removes the list of elements contained in the TypedDictionaryBase instance.
Declaration
public IDictionary Dictionary { get; }
Property Value
Type |
---|
System.Collections.IDictionary |
InnerHashtable
Gets / sets the list of elements contained in the TypedDictionaryBase instance.
Declaration
protected virtual Hashtable InnerHashtable { get; set; }
Property Value
Type |
---|
System.Collections.Hashtable |
IsFixedSize
Indicates whether the TypedDictionaryBase has a fixed size.
Declaration
public virtual bool IsFixedSize { get; }
Property Value
Type |
---|
System.Boolean |
IsReadOnly
Indicates whether the TypedDictionaryBase is Read-only.
Declaration
public virtual bool IsReadOnly { get; }
Property Value
Type |
---|
System.Boolean |
IsSynchronized
Indicates whether access to the TypedDictionaryBase is synchronized (thread-safe).
Declaration
public virtual bool IsSynchronized { get; }
Property Value
Type |
---|
System.Boolean |
Keys
Returns the list of keys contained in the TypedDictionaryBase instance.
Declaration
public ICollection Keys { get; }
Property Value
Type |
---|
System.Collections.ICollection |
SyncRoot
Gets an object that can be used to synchronize access to the TypedDictionaryBase.
Declaration
public virtual object SyncRoot { get; }
Property Value
Type |
---|
System.Object |
Values
Returns the list of values contained in the TypedDictionaryBase instance.
Declaration
public ICollection Values { get; }
Property Value
Type |
---|
System.Collections.ICollection |
Methods
Clear()
Clears the contents of the TypedDictionaryBase instance.
Declaration
public void Clear()
CopyTo(Array, Int32)
Copies the TypedDictionaryBase elements to a one-dimensional System.Array at the specified index.
Declaration
public void CopyTo(Array array, int index)
Parameters
Type | Name | Description |
---|---|---|
System.Array | array | The one-dimensional System.Array that is the destination of the System.Collections.DictionaryEntry objects copied from the TypedDictionaryBase instance. The System.Array must have zero-based indexing. |
System.Int32 | index | The zero-based index in an |
GetEnumerator()
Returns a System.Collections.IDictionaryEnumerator that can iterate through the TypedDictionaryBase instance.
Declaration
public IDictionaryEnumerator GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.IDictionaryEnumerator | A System.Collections.IDictionaryEnumerator for the TypedDictionaryBase instance. |
OnClear()
Performs additional custom processes before clearing the contents of the TypedDictionaryBase instance.
Declaration
protected virtual void OnClear()
OnGet(Object, Object)
Returns the element with the specified key and value in the TypedDictionaryBase instance.
Declaration
protected virtual object OnGet(object key, object currentValue)
Parameters
Type | Name | Description |
---|---|---|
System.Object | key | The key of the element to get. |
System.Object | currentValue | The current value of the element associated with |
Returns
Type | Description |
---|---|
System.Object | A System.Object containing the element with the specified key and value. |
OnInsert(Object, Object)
Performs additional custom processes before inserting a new element into the TypedDictionaryBase instance.
Declaration
protected virtual void OnInsert(object key, object value)
Parameters
Type | Name | Description |
---|---|---|
System.Object | key | The key of the element to insert. |
System.Object | value | The value of the element to insert. |
OnRemove(Object, Object)
Performs additional custom processes before removing an element from the TypedDictionaryBase instance.
Declaration
protected virtual void OnRemove(object key, object value)
Parameters
Type | Name | Description |
---|---|---|
System.Object | key | The key of the element to remove. |
System.Object | value | The value of the element to remove. |
OnSet(Object, Object, Object)
Performs additional custom processes before setting a value in the TypedDictionaryBase instance.
Declaration
protected virtual void OnSet(object key, object oldValue, object newValue)
Parameters
Type | Name | Description |
---|---|---|
System.Object | key | The key of the element to locate. |
System.Object | oldValue | The old value of the element associated with |
System.Object | newValue | The new value of the element associated with |
OnValidate(Object, Object)
Performs additional custom processes when validating the element with the specified key and value.
Declaration
protected virtual void OnValidate(object key, object value)
Parameters
Type | Name | Description |
---|---|---|
System.Object | key | The key of the element to validate. |
System.Object | value | The value of the element to validate. |
Explicit Interface Implementations
IDictionary.Add(Object, Object)
Adds the element with the specified key and value to the TypedDictionaryBase instance.
Declaration
void IDictionary.Add(object key, object value)
Parameters
Type | Name | Description |
---|---|---|
System.Object | key | |
System.Object | value |
IDictionary.Contains(Object)
Declaration
bool IDictionary.Contains(object key)
Parameters
Type | Name | Description |
---|---|---|
System.Object | key |
Returns
Type |
---|
System.Boolean |
IDictionary.get_Item(Object)
Declaration
object IDictionary.get_Item(object key)
Parameters
Type | Name | Description |
---|---|---|
System.Object | key |
Returns
Type |
---|
System.Object |
IDictionary.Item[Object]
Declaration
object IDictionary.this[] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
System.Object | key |
Returns
Type |
---|
System.Object |
IDictionary.Remove(Object)
Declaration
void IDictionary.Remove(object key)
Parameters
Type | Name | Description |
---|---|---|
System.Object | key |
IDictionary.set_Item(Object, Object)
Declaration
void IDictionary.set_Item(object key, object value)
Parameters
Type | Name | Description |
---|---|---|
System.Object | key | |
System.Object | value |
IEnumerable.GetEnumerator()
Returns the enumerator.
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.IEnumerator | Enumerator. |