Search Results for

    Show / Hide Table of Contents

    Class ObservableCollectionEx<T>

    Observable collection with ability to delay or suspend CollectionChanged notifications

    Inheritance
    System.Object
    System.Collections.ObjectModel.Collection<T>
    ObservableCollectionEx<T>
    Implements
    System.Collections.Generic.IList<T>
    System.Collections.Generic.ICollection<T>
    System.Collections.IList
    System.Collections.ICollection
    System.Collections.Generic.IReadOnlyList<T>
    System.Collections.Generic.IReadOnlyCollection<T>
    System.Collections.Generic.IEnumerable<T>
    System.Collections.IEnumerable
    System.Collections.Specialized.INotifyCollectionChanged
    System.ComponentModel.INotifyPropertyChanged
    System.IDisposable
    Inherited Members
    System.Collections.ObjectModel.Collection<T>.Add(T)
    System.Collections.ObjectModel.Collection<T>.Clear()
    System.Collections.ObjectModel.Collection<T>.CopyTo(T[], System.Int32)
    System.Collections.ObjectModel.Collection<T>.Contains(T)
    System.Collections.ObjectModel.Collection<T>.GetEnumerator()
    System.Collections.ObjectModel.Collection<T>.IndexOf(T)
    System.Collections.ObjectModel.Collection<T>.Insert(System.Int32, T)
    System.Collections.ObjectModel.Collection<T>.Remove(T)
    System.Collections.ObjectModel.Collection<T>.RemoveAt(System.Int32)
    System.Collections.ObjectModel.Collection<T>.System.Collections.IEnumerable.GetEnumerator()
    System.Collections.ObjectModel.Collection<T>.System.Collections.ICollection.CopyTo(System.Array, System.Int32)
    System.Collections.ObjectModel.Collection<T>.System.Collections.IList.get_Item(System.Int32)
    System.Collections.ObjectModel.Collection<T>.System.Collections.IList.set_Item(System.Int32, System.Object)
    System.Collections.ObjectModel.Collection<T>.System.Collections.IList.Add(System.Object)
    System.Collections.ObjectModel.Collection<T>.System.Collections.IList.Contains(System.Object)
    System.Collections.ObjectModel.Collection<T>.System.Collections.IList.IndexOf(System.Object)
    System.Collections.ObjectModel.Collection<T>.System.Collections.IList.Insert(System.Int32, System.Object)
    System.Collections.ObjectModel.Collection<T>.System.Collections.IList.Remove(System.Object)
    System.Collections.ObjectModel.Collection<T>.Count
    System.Collections.ObjectModel.Collection<T>.Items
    System.Collections.ObjectModel.Collection<T>.Item[System.Int32]
    System.Collections.ObjectModel.Collection<T>.System.Collections.Generic.ICollection<T>.IsReadOnly
    System.Collections.ObjectModel.Collection<T>.System.Collections.ICollection.IsSynchronized
    System.Collections.ObjectModel.Collection<T>.System.Collections.ICollection.SyncRoot
    System.Collections.ObjectModel.Collection<T>.System.Collections.IList.Item[System.Int32]
    System.Collections.ObjectModel.Collection<T>.System.Collections.IList.IsReadOnly
    System.Collections.ObjectModel.Collection<T>.System.Collections.IList.IsFixedSize
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: Simplic.Framework.DBUI
    Assembly: Simplic.Framework.DBUI.dll
    Syntax
    [Serializable]
    public class ObservableCollectionEx<T> : Collection<T>, IList<T>, ICollection<T>, IList, ICollection, IReadOnlyList<T>, IReadOnlyCollection<T>, IEnumerable<T>, IEnumerable, INotifyCollectionChanged, INotifyPropertyChanged, IDisposable
    Type Parameters
    Name Description
    T

    Constructors

    | Improve this Doc View Source

    ObservableCollectionEx()

    Initializes a new instance of ObservableCollectionEx that is empty and has default initial capacity.

    Declaration
    public ObservableCollectionEx()
    | Improve this Doc View Source

    ObservableCollectionEx(ObservableCollectionEx<T>, Boolean)

    Constructor that configures the container to delay or disable notifications.

    Declaration
    public ObservableCollectionEx(ObservableCollectionEx<T> parent, bool notify)
    Parameters
    Type Name Description
    ObservableCollectionEx<T> parent

    Reference to an original collection whos events are being postponed

    System.Boolean notify

    Specifies if notifications needs to be delayed or disabled

    | Improve this Doc View Source

    ObservableCollectionEx(IEnumerable<T>)

    Initializes a new instance of the ObservableCollection class that contains elements copied from the specified collection and has sufficient capacity to accommodate the number of elements copied.

    Declaration
    public ObservableCollectionEx(IEnumerable<T> collection)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<T> collection

    The collection whose elements are copied to the new list.

    Remarks

    The elements are copied onto the ObservableCollection in the same order they are read by the enumerator of the collection.

    Exceptions
    Type Condition
    System.ArgumentNullException

    collection is a null reference

    | Improve this Doc View Source

    ObservableCollectionEx(List<T>)

    Initializes a new instance of the ObservableCollectionEx class that contains elements copied from the specified list

    Declaration
    public ObservableCollectionEx(List<T> list)
    Parameters
    Type Name Description
    System.Collections.Generic.List<T> list

    The list whose elements are copied to the new list.

    Remarks

    The elements are copied onto the ObservableCollectionEx in the same order they are read by the enumerator of the list.

    Exceptions
    Type Condition
    System.ArgumentNullException

    list is a null reference

    Methods

    | Improve this Doc View Source

    AddRange(IEnumerable<T>)

    Declaration
    public void AddRange(IEnumerable<T> dataToAdd)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<T> dataToAdd
    | Improve this Doc View Source

    BlockReentrancy()

    Disallow reentrant attempts to change this collection. E.g. a event handler of the CollectionChanged event is not allowed to make changes to this collection.

    Declaration
    protected IDisposable BlockReentrancy()
    Returns
    Type Description
    System.IDisposable
    Remarks

    typical usage is to wrap e.g. a OnCollectionChanged call with a using() scope:

            using (BlockReentrancy()) 
            {
                CollectionChanged(this, new NotifyCollectionChangedEventArgs(action, item, index)); 
            } 
    | Improve this Doc View Source

    CheckReentrancy()

    Check and assert for reentrant attempts to change this collection.

    Declaration
    protected void CheckReentrancy()
    Exceptions
    Type Condition
    System.InvalidOperationException

    raised when changing the collection while another collection change is still being notified to other listeners

    | Improve this Doc View Source

    ClearItems()

    Called by base class Collection<T> when the list is being cleared; raises a CollectionChanged event to any listeners.

    Declaration
    protected override void ClearItems()
    Overrides
    System.Collections.ObjectModel.Collection<T>.ClearItems()
    | Improve this Doc View Source

    DelayNotifications()

    Declaration
    public ObservableCollectionEx<T> DelayNotifications()
    Returns
    Type Description
    ObservableCollectionEx<T>
    | Improve this Doc View Source

    DisableNotifications()

    Declaration
    public ObservableCollectionEx<T> DisableNotifications()
    Returns
    Type Description
    ObservableCollectionEx<T>
    | Improve this Doc View Source

    Dispose()

    Called by the application code to fire all delayed notifications.

    Declaration
    public void Dispose()
    | Improve this Doc View Source

    Dispose(Boolean)

    Fires notification with all accumulated events

    Declaration
    protected virtual void Dispose(bool reason)
    Parameters
    Type Name Description
    System.Boolean reason

    True is called by App code. False if called from GC.

    | Improve this Doc View Source

    Finalize()

    Distructor

    Declaration
    protected void Finalize()
    | Improve this Doc View Source

    InsertItem(Int32, T)

    Called by base class Collection<T> when an item is added to list; raises a CollectionChanged event to any listeners.

    Declaration
    protected override void InsertItem(int index, T item)
    Parameters
    Type Name Description
    System.Int32 index
    T item
    Overrides
    System.Collections.ObjectModel.Collection<T>.InsertItem(System.Int32, T)
    | Improve this Doc View Source

    Move(Int32, Int32)

    Move item at oldIndex to newIndex.

    Declaration
    public void Move(int oldIndex, int newIndex)
    Parameters
    Type Name Description
    System.Int32 oldIndex
    System.Int32 newIndex
    | Improve this Doc View Source

    MoveItem(Int32, Int32)

    Called by base class ObservableCollection<T> when an item is to be moved within the list; raises a CollectionChanged event to any listeners.

    Declaration
    protected virtual void MoveItem(int oldIndex, int newIndex)
    Parameters
    Type Name Description
    System.Int32 oldIndex
    System.Int32 newIndex
    | Improve this Doc View Source

    OnCollectionChanged(NotifyCollectionChangedEventArgs)

    Raise CollectionChanged event to any listeners. Properties/methods modifying this ObservableCollection will raise a collection changed event through this virtual method.

    Declaration
    protected virtual void OnCollectionChanged(NotifyCollectionChangedEventArgs e)
    Parameters
    Type Name Description
    System.Collections.Specialized.NotifyCollectionChangedEventArgs e
    Remarks

    When overriding this method, either call its base implementation or call BlockReentrancy() to guard against reentrant collection changes.

    | Improve this Doc View Source

    OnPropertyChanged(PropertyChangedEventArgs)

    Raises a PropertyChanged event (per System.ComponentModel.INotifyPropertyChanged).

    Declaration
    protected virtual void OnPropertyChanged(PropertyChangedEventArgs e)
    Parameters
    Type Name Description
    System.ComponentModel.PropertyChangedEventArgs e
    | Improve this Doc View Source

    RemoveItem(Int32)

    Called by base class Collection<T> when an item is removed from list; raises a CollectionChanged event to any listeners.

    Declaration
    protected override void RemoveItem(int index)
    Parameters
    Type Name Description
    System.Int32 index
    Overrides
    System.Collections.ObjectModel.Collection<T>.RemoveItem(System.Int32)
    | Improve this Doc View Source

    SetItem(Int32, T)

    Called by base class Collection<T> when an item is set in list; raises a CollectionChanged event to any listeners.

    Declaration
    protected override void SetItem(int index, T item)
    Parameters
    Type Name Description
    System.Int32 index
    T item
    Overrides
    System.Collections.ObjectModel.Collection<T>.SetItem(System.Int32, T)

    Events

    | Improve this Doc View Source

    CollectionChanged

    Occurs when the collection changes, either by adding or removing an item.

    Declaration
    protected virtual event NotifyCollectionChangedEventHandler CollectionChanged
    Event Type
    Type Description
    System.Collections.Specialized.NotifyCollectionChangedEventHandler
    Remarks

    See System.Collections.Specialized.INotifyCollectionChanged

    | Improve this Doc View Source

    PropertyChanged

    PropertyChanged event System.ComponentModel.INotifyPropertyChanged.

    Declaration
    protected virtual event PropertyChangedEventHandler PropertyChanged
    Event Type
    Type Description
    System.ComponentModel.PropertyChangedEventHandler

    Explicit Interface Implementations

    | Improve this Doc View Source

    INotifyCollectionChanged.CollectionChanged

    Occurs when the collection changes, either by adding or removing an item.

    Declaration
    event NotifyCollectionChangedEventHandler INotifyCollectionChanged.CollectionChanged
    Returns
    Type Description
    System.Collections.Specialized.NotifyCollectionChangedEventHandler
    Remarks

    see System.Collections.Specialized.INotifyCollectionChanged

    | Improve this Doc View Source

    INotifyPropertyChanged.PropertyChanged

    PropertyChanged event (per System.ComponentModel.INotifyPropertyChanged).

    Declaration
    event PropertyChangedEventHandler INotifyPropertyChanged.PropertyChanged
    Returns
    Type Description
    System.ComponentModel.PropertyChangedEventHandler

    Implements

    System.Collections.Generic.IList<T>
    System.Collections.Generic.ICollection<T>
    System.Collections.IList
    System.Collections.ICollection
    System.Collections.Generic.IReadOnlyList<T>
    System.Collections.Generic.IReadOnlyCollection<T>
    System.Collections.Generic.IEnumerable<T>
    System.Collections.IEnumerable
    System.Collections.Specialized.INotifyCollectionChanged
    System.ComponentModel.INotifyPropertyChanged
    System.IDisposable

    Extension Methods

    NumericExtension.Sum<T>(IEnumerable<T>, Func<T, Numeric>)
    PreciseDecimalExtension.Sum<T>(IEnumerable<T>, Func<T, PreciseDecimal>)
    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright © 2018 SIMPLIC GmbH
    Generated by DocFx