Class BaseCollection<T>
An observable collection which splits the System.Collections.ObjectModel.ObservableCollection`1.CollectionChanged event into separate events.
Inheritance
Namespace: Telerik.Windows.Diagrams.Core
Assembly: Telerik.Windows.Diagrams.Core.dll
Syntax
public class BaseCollection<T> : ObservableCollection<T>
Type Parameters
T
The type on which the collection is based. |
Constructors
BaseCollection()
BaseCollection(Boolean)
Initializes a new instance of the BaseCollection<T> class.
Declaration
public BaseCollection(bool raiseEventsByDefault)
Parameters
System.Boolean
raiseEventsByDefault
The raise events by default. |
BaseCollection(IEnumerable<T>)
Initializes a new instance of the BaseCollection<T> class. Initializes a new instance of the BaseCollection<T> class.
Declaration
public BaseCollection(IEnumerable<T> collection)
Parameters
System.Collections.Generic.IEnumerable<T>
collection
The collection. |
Methods
Add(T)
Adds an item to the collection.
Declaration
public void Add(T item)
Parameters
T
item
The item to be added. |
Add(T, Boolean)
Adds and new item to the collection and specifies whether to raise the ItemAdded event.
Declaration
public void Add(T item, bool raise)
Parameters
T
item
The item to add to the collection. |
System.Boolean
raise
Whether to raise the ItemAdded event. |
Clear()
Clears this collection.
Declaration
public void Clear()
Clear(Boolean)
Clears this collection.
Declaration
public void Clear(bool raise)
Parameters
System.Boolean
raise
Whether to raise the Cleared event. |
Insert(Int32, T)
Inserts an item to this collection.
Declaration
public void Insert(int index, T item)
Parameters
System.Int32
index
The index at which the item should be inserted. |
T
item
The item to insert. |
Insert(Int32, T, Boolean)
Inserts an item to this collection.
Declaration
public void Insert(int index, T item, bool raise)
Parameters
System.Int32
index
The index at which the item should be inserted. |
T
item
The item to insert. |
System.Boolean
raise
Whether to raise the ItemInserted event. |
Remove(T)
Removes an item from this collection.
Declaration
public void Remove(T item)
Parameters
T
item
The item to remove. |
Remove(T, Boolean)
Removes an item from this collection.
Declaration
public void Remove(T item, bool raise)
Parameters
T
item
The item to remove. |
System.Boolean
raise
Whether to raise the ItemRemoved event. |
Events
Cleared
Occurs when the collection is cleared.
Declaration
public event EventHandler Cleared
Event Type
System.EventHandler
|
ItemAdded
Occurs when an item is added.
Declaration
public event EventHandler<GenericEventArgs<T>> ItemAdded
Event Type
System.EventHandler<GenericEventArgs<T>>
|
ItemInserted
Occurs when an item is inserted.
Declaration
public event EventHandler<GenericEventArgs<T>> ItemInserted
Event Type
System.EventHandler<GenericEventArgs<T>>
|
ItemRemoved
Occurs when an item is removed.
Declaration
public event EventHandler<GenericEventArgs<T>> ItemRemoved
Event Type
System.EventHandler<GenericEventArgs<T>>
|