Class Collection<T>
Represents collection with change tracking.
Inheritance
Implements
Inherited Members
Namespace: Mediachase.BusinessFoundation.Data
Assembly: Mediachase.BusinessFoundation.Data.dll
Version: 12.17.2Syntax
public class Collection<T> : Collection<T>, IList<T>, ICollection<T>, IList, ICollection, IReadOnlyList<T>, IReadOnlyCollection<T>, IEnumerable<T>, IEnumerable, IChangeTracking
Type Parameters
Name | Description |
---|---|
T |
Constructors
Collection()
Initializes a new instance of the Collection<T> class.
Declaration
public Collection()
Properties
IsChanged
Gets a value indicating whether this instance is changed.
Declaration
protected virtual bool IsChanged { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Methods
AcceptChanges()
Accepts the changes.
Declaration
protected virtual void AcceptChanges()
AddRange(IEnumerable<T>)
Adds the range.
Declaration
public virtual void AddRange(IEnumerable<T> collection)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<T> | collection | The collection. |
ClearItems()
Removes all elements from the System.Collections.ObjectModel.Collection<T>.
Declaration
protected override void ClearItems()
Overrides
InsertItem(Int32, T)
Inserts the item.
Declaration
protected override void InsertItem(int index, T item)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The index. |
T | item | The object to insert. The value can be null for reference types. |
Overrides
Exceptions
Type | Condition |
---|---|
System.ArgumentOutOfRangeException | index is less than zero.-or-index is greater than System.Collections.ObjectModel.Collection<T>.Count. |
OnChanged(CollectionChangedEventArgs<T>)
Called when [changed].
Declaration
protected virtual void OnChanged(CollectionChangedEventArgs<T> argument)
Parameters
Type | Name | Description |
---|---|---|
CollectionChangedEventArgs<T> | argument | The argument. |
OnChanging(CollectionChangedEventArgs<T>)
Called when [changing].
Declaration
protected virtual void OnChanging(CollectionChangedEventArgs<T> argument)
Parameters
Type | Name | Description |
---|---|---|
CollectionChangedEventArgs<T> | argument | The argument. |
RemoveItem(Int32)
Removes the element at the specified index of the System.Collections.ObjectModel.Collection<T>.
Declaration
protected override void RemoveItem(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The zero-based index of the element to remove. |
Overrides
Exceptions
Type | Condition |
---|---|
System.ArgumentOutOfRangeException | index is less than zero.-or-index is equal to or greater than System.Collections.ObjectModel.Collection<T>.Count. |
SetItem(Int32, T)
Sets the item.
Declaration
protected override void SetItem(int index, T item)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The index. |
T | item | The new value for the element at the specified index. The value can be null for reference types. |
Overrides
Exceptions
Type | Condition |
---|---|
System.ArgumentOutOfRangeException | index is less than zero.-or-index is greater than System.Collections.ObjectModel.Collection<T>.Count. |
ToArray()
Toes the array.
Declaration
public virtual T[] ToArray()
Returns
Type | Description |
---|---|
T[] |
Events
Changed
Declaration
public event EventHandler<CollectionChangedEventArgs<T>> Changed
Event Type
Type | Description |
---|---|
System.EventHandler<CollectionChangedEventArgs<T>> |
Changing
Declaration
public event EventHandler<CollectionChangedEventArgs<T>> Changing
Event Type
Type | Description |
---|---|
System.EventHandler<CollectionChangedEventArgs<T>> |
Explicit Interface Implementations
IChangeTracking.AcceptChanges()
Accepts the changes.
Declaration
void IChangeTracking.AcceptChanges()
IChangeTracking.IsChanged
Gets a value indicating whether this instance is changed.
Declaration
bool IChangeTracking.IsChanged { get; }
Returns
Type | Description |
---|---|
System.Boolean |
|