DataStoreVirtualCollection<T>

public class DataStoreVirtualCollection<T> : IList<T>, IList
Translates an IDataStore<T> to a read-only IList<T>
Remarks: This is typically used to pass the data store to controls that require a standard collection
T

Constructors

DataStoreVirtualCollection

#
public DataStoreVirtualCollection(IDataStore<T> store)
Initializes a new instance of the DataStoreVirtualCollection<T> class.

Properties

Count

#
public int Count { get; }
Gets the count of items in this collection

IsFixedSize

#
public bool IsFixedSize { get; }
Gets a value indicating whether this instance is fixed size.

IsReadOnly

#
public bool IsReadOnly { get; }
Gets a value indicating whether this instance is read only.

IsSynchronized

#
public bool IsSynchronized { get; }
Gets a value indicating whether this instance is synchronized.

Indexers

this[]

#
public T this[int index] { get; set; }
Gets or sets the item at the specified index. This collection is read-only so setting the item throws an exception.

Methods

Add

#
public int Add(object value)
Adds an item to the current collection.

Add

#
public void Add(T item)
Adds an item to the current collection. This collection is read-only so this throws an exception.

Clear

#
public void Clear()
Clears all items from the collection. This collection is read-only so this throws an exception.

Contains

#
public bool Contains(object value)
Determines whether the current collection contains a specific value.

Contains

#
public bool Contains(T item)
Determines whether the current collection contains a specific value.

CopyTo

#
public void CopyTo(Array array, int index)
Copies the contents of the collection to the specified array starting at the specified index

CopyTo

#
public void CopyTo(T[] array, int arrayIndex)
Copies the contents of the collection to the specified array starting at the specified index
array (T[])Array to copy to
arrayIndex (int)Index in the array to start copying to

GetEnumerator

#
public IEnumerator<T> GetEnumerator()
Gets the enumerator for the collection

IndexOf

#
public int IndexOf(object value)
Determines the index of a specific item in the current instance.
value (object)Value to find
Index of the item if found, or -1 if not in the collection

IndexOf

#
public int IndexOf(T item)
Determines the index of a specific item in the collection.
item (T)Item to find the index
The index of the item if found, or -1 if not found

Insert

#
public void Insert(int index, object value)
Insert a value into the collection with the specified index

Insert

#
public void Insert(int index, T item)
Inserts an item at the specified index. This collection is read-only so this throws an exception.

Remove

#
public bool Remove(T item)
Remove the specified item. This collection is read-only so this throws an exception.

Remove

#
public void Remove(object value)
Removes the first occurrence of an item from the current collection.

RemoveAt

#
public void RemoveAt(int index)
Removes the item at the specified index. This collection is read-only so this throws an exception.