Class ObservableList<T>
Extends List{T} with events.
Inheritance
System.Object
ObservableList<T>
Implements
System.Collections.IList
System.Collections.ICollection
System.Collections.IEnumerable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: Syncfusion.Shared.Base.dll
public class ObservableList<T> : IList, ICollection, IEnumerable
Type Parameters
Name |
Description |
T |
Type of collection elements.
|
Constructors
Declaration
Declaration
public ObservableList(int capacity)
Parameters
Type |
Name |
Description |
System.Int32 |
capacity |
|
Properties
Declaration
public int Capacity { get; set; }
Property Value
Declaration
public int Count { get; }
Property Value
Gets or sets the element at the specified index.
Declaration
public T this[int index] { get; set; }
Parameters
Type |
Name |
Description |
System.Int32 |
index |
|
Property Value
Declaration
protected IList List { get; }
Property Value
Type |
System.Collections.IList |
Methods
Declaration
Parameters
Type |
Name |
Description |
T |
value |
|
Returns
Removes all items from the list.
Declaration
Determines whether the list contains a specific value.
Declaration
public bool Contains(T value)
Parameters
Type |
Name |
Description |
T |
value |
|
Returns
Declaration
public IEnumerator GetEnumerator()
Returns
Type |
System.Collections.IEnumerator |
Determines the index of a specific item in the list.
Declaration
public int IndexOf(T value)
Parameters
Type |
Name |
Description |
T |
value |
|
Returns
Inserts an item to the list at the specified index.
Declaration
public void Insert(int index, T value)
Parameters
Type |
Name |
Description |
System.Int32 |
index |
|
T |
value |
|
Declaration
protected virtual void OnClear()
Declaration
protected virtual void OnClearCompleted()
Performs additional custom processes before inserting a new element into the collection.
Declaration
protected virtual bool OnInsert(int index, object value)
Parameters
Type |
Name |
Description |
System.Int32 |
index |
|
System.Object |
value |
|
Returns
Type |
Description |
System.Boolean |
TRUE to insert object
|
Declaration
protected virtual void OnInsertComplete(int index, object value)
Parameters
Type |
Name |
Description |
System.Int32 |
index |
|
System.Object |
value |
|
Performs additional custom processes when removing an element from the collection.
Declaration
protected virtual bool OnRemove(int index, object value)
Parameters
Type |
Name |
Description |
System.Int32 |
index |
|
System.Object |
value |
|
Returns
Type |
Description |
System.Boolean |
TRUE to remove object
|
Declaration
protected virtual void OnRemoveComplete(int index, object value)
Parameters
Type |
Name |
Description |
System.Int32 |
index |
|
System.Object |
value |
|
Removes the first occurrence of a specific object from the collection.
Declaration
public void Remove(T value)
Parameters
Type |
Name |
Description |
T |
value |
|
Removes item at the specified index.
Declaration
public void RemoveAt(int index)
Parameters
Type |
Name |
Description |
System.Int32 |
index |
|
Declaration
public void Sort(IComparer comparer)
Parameters
Type |
Name |
Description |
System.Collections.IComparer |
comparer |
|
Events
Fired when new item is added to the collection.
Declaration
public event EventHandler<ListItemEventArgs<T>> ItemAdded
Event Type
Fired when item is removed from collection.
Declaration
public event EventHandler<ListItemEventArgs<T>> ItemRemoved
Event Type
Explicit Interface Implementations
Copies the elements of the ICollection to an Array, starting at a particular Array index.
Declaration
void ICollection.CopyTo(Array array, int index)
Parameters
Type |
Name |
Description |
System.Array |
array |
|
System.Int32 |
index |
|
Gets the number of elements contained in the ICollection.
Declaration
int ICollection.Count { get; }
Returns
Gets a value indicating whether access to the collection is synchronized
Declaration
bool ICollection.IsSynchronized { get; }
Returns
Gets an object that can be used to synchronize access to the collection.
Declaration
object ICollection.SyncRoot { get; }
Returns
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type |
System.Collections.IEnumerator |
Adds an item to the list.
Declaration
int IList.Add(object value)
Parameters
Type |
Name |
Description |
System.Object |
value |
|
Returns
Removes all items from the list.
Declaration
Determines whether the list contains a specific value.
Declaration
bool IList.Contains(object value)
Parameters
Type |
Name |
Description |
System.Object |
value |
|
Returns
Declaration
object IList.get_Item(int index)
Parameters
Type |
Name |
Description |
System.Int32 |
index |
|
Returns
Determines the index of a specific item in the list.
Declaration
int IList.IndexOf(object value)
Parameters
Type |
Name |
Description |
System.Object |
value |
|
Returns
Inserts an item to the list at the specified index.
Declaration
void IList.Insert(int index, object value)
Parameters
Type |
Name |
Description |
System.Int32 |
index |
|
System.Object |
value |
|
Gets a value indicating whether the list has a fixed size.
Declaration
bool IList.IsFixedSize { get; }
Returns
Gets a value indicating whether the list is read-only.
Declaration
bool IList.IsReadOnly { get; }
Returns
Gets or sets the element at the specified index.
Declaration
object IList.this[] { get; set; }
Parameters
Type |
Name |
Description |
System.Int32 |
index |
|
Returns
Removes the first occurrence of a specific object from the list.
Declaration
void IList.Remove(object value)
Parameters
Type |
Name |
Description |
System.Object |
value |
|
Removes item at the specified index.
Declaration
void IList.RemoveAt(int index)
Parameters
Type |
Name |
Description |
System.Int32 |
index |
|
Declaration
void IList.set_Item(int index, object value)
Parameters
Type |
Name |
Description |
System.Int32 |
index |
|
System.Object |
value |
|
Implements
System.Collections.IList
System.Collections.ICollection
System.Collections.IEnumerable
Extension Methods