Struct TouchCollection
Provides state information for a touch screen enabled device.
public struct TouchCollection : IList<TouchLocation>, ICollection<TouchLocation>, IEnumerable<TouchLocation>, IEnumerable
- Implements
- Inherited Members
Constructors
TouchCollection(TouchLocation[])
Initializes a new instance of the TouchCollection with a pre-determined set of touch locations.
public TouchCollection(TouchLocation[] touches)
Parameters
touches
TouchLocation[]Array of TouchLocation items to initialize with.
Properties
Count
Returns the number of TouchLocation items that exist in the collection.
public int Count { get; }
Property Value
IsConnected
States if a touch screen is available.
public bool IsConnected { get; }
Property Value
IsReadOnly
States if touch collection is read only.
public bool IsReadOnly { get; }
Property Value
this[int]
Gets or sets the item at the specified index of the collection.
public TouchLocation this[int index] { get; set; }
Parameters
index
intPosition of the item.
Property Value
Methods
Add(TouchLocation)
Adds a TouchLocation to the collection.
public void Add(TouchLocation item)
Parameters
item
TouchLocationThe TouchLocation item to be added.
Clear()
Clears all the items in collection.
public void Clear()
Contains(TouchLocation)
Returns true if specified TouchLocation item exists in the collection, false otherwise./>
public bool Contains(TouchLocation item)
Parameters
item
TouchLocationThe TouchLocation item to query for.
Returns
- bool
Returns true if queried item is found, false otherwise.
CopyTo(TouchLocation[], int)
Copies the TouchLocationcollection to specified array starting from the given index.
public void CopyTo(TouchLocation[] array, int arrayIndex)
Parameters
array
TouchLocation[]The array to copy TouchLocation items.
arrayIndex
intThe starting index of the copy operation.
FindById(int, out TouchLocation)
Returns TouchLocation specified by ID.
public bool FindById(int id, out TouchLocation touchLocation)
Parameters
id
inttouchLocation
TouchLocation
Returns
GetEnumerator()
Returns an enumerator for the TouchCollection.
public TouchCollection.Enumerator GetEnumerator()
Returns
- TouchCollection.Enumerator
Enumerable list of TouchLocation objects.
IndexOf(TouchLocation)
Returns the index of the first occurrence of specified TouchLocation item in the collection.
public int IndexOf(TouchLocation item)
Parameters
item
TouchLocationTouchLocation to query.
Returns
Insert(int, TouchLocation)
Inserts a TouchLocation item into the indicated position.
public void Insert(int index, TouchLocation item)
Parameters
index
intThe position to insert into.
item
TouchLocationThe TouchLocation item to insert.
Remove(TouchLocation)
Removes the specified TouchLocation item from the collection.
public bool Remove(TouchLocation item)
Parameters
item
TouchLocationThe TouchLocation item to remove.
Returns
RemoveAt(int)
Removes the TouchLocation item at specified index.
public void RemoveAt(int index)
Parameters
index
intIndex of the item that will be removed from collection.