Class SortedRangeValueList<T>
A sorted list with RangeValuePair<T> ordered by the start index of the ranges. SortedRangeValueList ensures that ranges of the elements inside the list do not overlap and it also ensures that there are no empty gaps meaning that the subsequent range will always have the Start position be set to the End position of the previous range plus one.
Inheritance
Inherited Members
Namespace: Syncfusion.WinForms.GridCommon.ScrollAxis
Assembly: Syncfusion.GridCommon.WinForms.dll
Syntax
public class SortedRangeValueList<T> : IEnumerable<RangeValuePair<T>>, IEnumerable
Type Parameters
Name |
---|
T |
Constructors
SortedRangeValueList()
Initializes a new instance of the SortedRangeValueList<T> class.
Declaration
public SortedRangeValueList()
SortedRangeValueList(T)
Initializes a new instance of the SortedRangeValueList<T> class.
Declaration
public SortedRangeValueList(T defaultValue)
Parameters
Type | Name | Description |
---|---|---|
T | defaultValue | The default value used for filling gaps. |
Properties
Count
Gets the count which is the same as the end position of the last range.
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
System.Int32 | The count. |
DefaultValue
Gets or sets the default value used for filling gaps.
Declaration
public T DefaultValue { get; set; }
Property Value
Type | Description |
---|---|
T | The default value. |
Item[Int32]
Gets the value of the range that contains the specified index or changes the value of the range. When necessary it splits a range and creates a new range value pair to hold the new value for the specified index.
Declaration
public T this[int index] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index |
Property Value
Type |
---|
T |
Methods
GetEnumerator()
Returns an enumerator that iterates through a collection.
Declaration
public IEnumerator GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.IEnumerator | An System.Collections.IEnumerator object that can be used to iterate through the collection. |
GetRange(Int32, out Int32)
Gets a range that contains the specified index and also returns a count indicating the delta between the index and the end of the range.
Declaration
public T GetRange(int index, out int count)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The index. |
System.Int32 | count | The count. |
Returns
Type |
---|
T |
Insert(Int32, Int32)
Inserts a range intialized with DefaultValue at the specified index. When necessary it splits a range and creates a new range value pair.
Declaration
public void Insert(int insertAt, int count)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | insertAt | The insertion point. |
System.Int32 | count | The count. |
Insert(Int32, Int32, T)
Inserts a range intialized with a given value at the specified index. When necessary it splits a range and creates a new range value pair.
Declaration
public void Insert(int insertAt, int count, T value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | insertAt | The insertion point. |
System.Int32 | count | The count. |
T | value | The value. |
Insert(Int32, Int32, T, SortedRangeValueList<T>)
Inserts a range intialized with a given value at the specified index. When necessary it splits a range and creates a new range value pair.
Declaration
public void Insert(int insertAt, int count, T value, SortedRangeValueList<T> moveRanges)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | insertAt | The insertion point. |
System.Int32 | count | The count. |
T | value | The value. |
SortedRangeValueList<T> | moveRanges | Allocate this object before a preceeding Remove call when moving ranges. Otherwise specify null. |
Insert(Int32, Int32, SortedRangeValueList<T>)
Inserts a range intialized with DefaultValue at the specified index. When necessary it splits a range and creates a new range value pair.
Declaration
public void Insert(int insertAt, int count, SortedRangeValueList<T> moveRanges)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | insertAt | The insertion point. |
System.Int32 | count | The count. |
SortedRangeValueList<T> | moveRanges | Allocate this object before a preceeding Remove call when moving ranges. Otherwise specify null. |
Remove(Int32, Int32)
Removes a range at the specified index. When necessary ranges are merged when preceeding and subsquent ranges have the same value.
Declaration
public void Remove(int removeAt, int count)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | removeAt | The index for the range to be removed. |
System.Int32 | count | The count. |
Remove(Int32, Int32, SortedRangeValueList<T>)
Removes a range at the specified index. When necessary ranges are merged when preceeding and subsquent ranges have the same value.
Declaration
public void Remove(int removeAt, int count, SortedRangeValueList<T> moveRanges)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | removeAt | The index for the range to be removed. |
System.Int32 | count | The count. |
SortedRangeValueList<T> | moveRanges | Allocate this object before a Remove call when moving ranges and pass it to a subsequent Insert call. Otherwise specify null. |
SetRange(Int32, Int32, T)
Sets the value for a range at the specified index. When necessary ranges are split or merged to make sure integrity of the list is maintained. (SortedRangeValueList ensures that ranges of the elements inside the list do not overlap and it also ensures that there are no empty gaps meaning that the subsequent range will always have the Start position be set to the End position of the previous range plus one.)
Declaration
public void SetRange(int index, int count, T value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The index for the range to be changed. |
System.Int32 | count | The count. |
T | value | The value. |
Explicit Interface Implementations
IEnumerable<RangeValuePair<T>>.GetEnumerator()
Returns an enumerator that iterates through the collection.
Declaration
IEnumerator<RangeValuePair<T>> IEnumerable<RangeValuePair<T>>.GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerator<RangeValuePair<T>> | A enumerator that can be used to iterate through the collection. |