Class GridIndexDictionary
Implements a collection with index / value pairs stored in a System.Collections.Hashtable and lets you insert, remove, or move values in the collection and indexes will be updated.
Implements
Inherited Members
Namespace: Syncfusion.Windows.Forms.Grid
Assembly: Syncfusion.Grid.Windows.dll
Syntax
public class GridIndexDictionary : TypedDictionaryBase, IDictionary, ICollection, IEnumerable, ICloneable, ISerializable
Remarks
GridModelHideRowColsIndexer and GridModelRowColSizeIndexer store row, column sizes, and hidden states in a GridIndexDictionary.
Constructors
GridIndexDictionary(Hashtable, Type)
Initializes a new instanceGridIndexDictionary and specifies the hash table and type of values this collection holds.
Declaration
protected GridIndexDictionary(Hashtable hashtable, Type memberType)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Hashtable | hashtable | The inner hash table to be associated with this GridIndexDictionary. |
System.Type | memberType | The type of values this collection holds. |
GridIndexDictionary(SerializationInfo, StreamingContext)
Initializes a new instanceGridIndexDictionary from a serialization stream.
Declaration
protected GridIndexDictionary(SerializationInfo info, StreamingContext context)
Parameters
Type | Name | Description |
---|---|---|
System.Runtime.Serialization.SerializationInfo | info | An object that holds all the data needed to serialize or de-serialize this instance. |
System.Runtime.Serialization.StreamingContext | context | Describes the source and destination of the serialized stream specified by info. |
GridIndexDictionary(Type)
Initializes a new instance ofGridIndexDictionary and specifies the type of values this collection holds.
Declaration
public GridIndexDictionary(Type memberType)
Parameters
Type | Name | Description |
---|---|---|
System.Type | memberType | The type of values this collection holds. |
Properties
Item[Int32]
Gets or sets the value at the specified index.
Declaration
public object this[int key] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | key |
Property Value
Type |
---|
System.Object |
LargestKey
Gets the largest index in the collection.
Declaration
public int LargestKey { get; }
Property Value
Type |
---|
System.Int32 |
MemberType
Gets the MemberType. Used internally.
Declaration
public Type MemberType { get; }
Property Value
Type |
---|
System.Type |
SmallestKey
Gets the smallest index in the collection.
Declaration
public int SmallestKey { get; }
Property Value
Type |
---|
System.Int32 |
Methods
Add(Int32, Object)
Adds an index / value pair.
Declaration
public void Add(int key, object value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | key | The index for the value. |
System.Object | value | The value. |
Clone()
Creates an exact copy of this GridIndexDictionary.
Declaration
public GridIndexDictionary Clone()
Returns
Type | Description |
---|---|
GridIndexDictionary | A GridIndexDictionary with all values copied over. |
Contains(Int32)
Checks if the collection has an entry at the specified index.
Declaration
public bool Contains(int key)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | key | The index for the value. |
Returns
Type | Description |
---|---|
System.Boolean | True if a value exists at the index; False otherwise. |
CopyTo(Object[], Int32)
Copies the values to a one-dimensional System.Array instance at the specified index.
Declaration
public void CopyTo(object[] array, int index)
Parameters
Type | Name | Description |
---|---|---|
System.Object[] | array | The one-dimensional System.Array that is the destination of the values copied from the GridCellModelCollection. |
System.Int32 | index | The index in the array where copying begins. |
GetHashTable()
Gets the hash table. Used internally.
Declaration
public Hashtable GetHashTable()
Returns
Type | Description |
---|---|
System.Collections.Hashtable | returns Hash table. |
GetObjectData(SerializationInfo, StreamingContext)
Implements the ISerializable interface and returns the data needed to serialize the GridIndexDictionary.
Declaration
public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
Type | Name | Description |
---|---|---|
System.Runtime.Serialization.SerializationInfo | info | A SerializationInfo object containing the information required to serialize the object. |
System.Runtime.Serialization.StreamingContext | context | A StreamingContext object containing the source and destination of the serialized stream. |
InsertIndex(Int32, Int32)
Inserts a specified number of values at a specific index and adjusts the index for subsequent values.
Declaration
public void InsertIndex(int index, int count)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The index where to start inserting values. |
System.Int32 | count | The number of values to insert. |
Lookup(Int32, out Int32)
Determines if a System.Int32 value is stored at a specific index and returns its value.
Declaration
public bool Lookup(int key, out int result)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | key | The index to look up. |
System.Int32 | result | The value at the specified index. |
Returns
Type | Description |
---|---|
System.Boolean | True if value exists; False otherwise. |
Lookup(Int32, out Object)
Determines if a System.Object value is stored at a specific index and returns its value.
Declaration
public bool Lookup(int key, out object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | key | The index to look up. |
System.Object | obj | The value at the specified index. |
Returns
Type | Description |
---|---|
System.Boolean | True if value exists; False otherwise. |
Lookup(Int32, out Single)
Determines if a System.Single value is stored at a specific index and returns its value.
Declaration
public bool Lookup(int key, out float result)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | key | The index to look up. |
System.Single | result | The value at the specified index. |
Returns
Type | Description |
---|---|
System.Boolean | True if value exists; False otherwise. |
MoveIndex(Int32, Int32, Int32)
Moves a specified number of values to a new index and adjusts the indexes of subsequent values.
Declaration
public void MoveIndex(int from, int count, int dest)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | from | The index where to start moving values. |
System.Int32 | count | The number of values to move. |
System.Int32 | dest | The destination index. |
OnInsert(Object, Object)
Invoked when the Key and value pair inserted into the dictionary.
Declaration
protected override void OnInsert(object key, object value)
Parameters
Type | Name | Description |
---|---|---|
System.Object | key | Key value. |
System.Object | value | Corresponding value of that key. |
Overrides
OnRemove(Object, Object)
Invoked when the Key and value pair removed from the dictionary.
Declaration
protected override void OnRemove(object key, object value)
Parameters
Type | Name | Description |
---|---|---|
System.Object | key | Key value. |
System.Object | value | Corresponding value of that key. |
Overrides
OnSet(Object, Object, Object)
Sets the new value.
Declaration
protected override void OnSet(object key, object oldValue, object newValue)
Parameters
Type | Name | Description |
---|---|---|
System.Object | key | |
System.Object | oldValue | |
System.Object | newValue |
Overrides
OnValidate(Object, Object)
Validates the key,value pair in the dictionary.
Declaration
protected override void OnValidate(object key, object value)
Parameters
Type | Name | Description |
---|---|---|
System.Object | key | |
System.Object | value |
Overrides
Exceptions
Type | Condition |
---|---|
System.ArgumentException | if |
Remove(Int32)
Removes the value at the specified index.
Declaration
public void Remove(int key)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | key | The Index. |
RemoveIndex(Int32, Int32)
Removes a specified number of values at a specific index and adjusts the index for subsequent values.
Declaration
public void RemoveIndex(int from, int count)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | from | The index where to start removing values. |
System.Int32 | count | The number of values to remove. |
Explicit Interface Implementations
ICloneable.Clone()
Creates a new object that is a copy of the current instance.
Declaration
object ICloneable.Clone()
Returns
Type | Description |
---|---|
System.Object | A new object that is a copy of this instance. |