Class CurveKeyCollection
[DataContract]
public class CurveKeyCollection : ICollection<CurveKey>, IEnumerable<CurveKey>, IEnumerable
- Inheritance
-
CurveKeyCollection
- Implements
- Inherited Members
Constructors
CurveKeyCollection()
Creates a new instance of CurveKeyCollection class.
public CurveKeyCollection()
Properties
Count
Returns the count of keys in this collection.
[DataMember]
public int Count { get; }
Property Value
IsReadOnly
Returns false because it is not a read-only collection.
[DataMember]
public bool IsReadOnly { get; }
Property Value
this[int]
Indexer.
[DataMember(Name = "Items")]
public CurveKey this[int index] { get; set; }
Parameters
index
intThe index of key in this collection.
Property Value
Methods
Add(CurveKey)
Adds a key to this collection.
public void Add(CurveKey item)
Parameters
item
CurveKeyNew key for the collection.
Remarks
The new key would be added respectively to a position of that key and the position of other keys.
Exceptions
- ArgumentNullException
Throws if
item
is null.
Clear()
Removes all keys from this collection.
public void Clear()
Clone()
Creates a copy of this collection.
public CurveKeyCollection Clone()
Returns
- CurveKeyCollection
A copy of this collection.
Contains(CurveKey)
Determines whether this collection contains a specific key.
public bool Contains(CurveKey item)
Parameters
item
CurveKeyThe key to locate in this collection.
Returns
- bool
true
if the key is found;false
otherwise.
CopyTo(CurveKey[], int)
Copies the keys of this collection to an array, starting at the array index provided.
public void CopyTo(CurveKey[] array, int arrayIndex)
Parameters
array
CurveKey[]Destination array where elements will be copied.
arrayIndex
intThe zero-based index in the array to start copying from.
GetEnumerator()
Returns an enumerator that iterates through the collection.
public IEnumerator<CurveKey> GetEnumerator()
Returns
- IEnumerator<CurveKey>
An enumerator for the CurveKeyCollection.
IndexAtPosition(float)
Searches for the key with the lowest position greater than or equal to the specified position.
public int IndexAtPosition(float position)
Parameters
position
floatPosition to search for.
Returns
- int
The zero-based index of the first matching position if there is a match; otherwise, a negative number that is the bitwise complement of the index of the next element that is larger than
position
or, if there is no larger element, the bitwise complement ofCount
.
IndexOf(CurveKey)
Finds element in the collection and returns its index.
public int IndexOf(CurveKey item)
Parameters
item
CurveKeyElement for the search.
Returns
- int
Index of the element; or -1 if item is not found.
Remove(CurveKey)
Removes specific element.
public bool Remove(CurveKey item)
Parameters
item
CurveKeyThe element
Returns
- bool
true
if item is successfully removed;false
otherwise. This method also returnsfalse
if item was not found.
RemoveAt(int)
Removes element at the specified index.
public void RemoveAt(int index)
Parameters
index
intThe index which element will be removed.