ObservableBindingListTBlockReentrancy Method

Disallows reentrant attempts to change this collection.

Definition

Namespace: KGySoft.ComponentModel
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 7.0.0
C#
protected IDisposable BlockReentrancy()

Return Value

IDisposable
An IDisposable instance that can be used to create a block of protected scope.

Remarks

Typical usage is to wrap event invocations with a using scope:
C#
using (BlockReentrancy())
{
    OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
    OnListChanged(new ListChangedEventArgs(ListChangedType.Reset, -1));
}

See Also