語言

ObservableCollection<T>.BlockReentrancy 方法

定義

禁止重新進入者嘗試更改此集合。

protected:
 IDisposable ^ BlockReentrancy();
protected IDisposable BlockReentrancy();
member this.BlockReentrancy : unit -> IDisposable
Protected Function BlockReentrancy () As IDisposable

傳回

一個 IDisposable 可以用來處理該物品的物品。

範例

典型用法是在作用OnCollectionChanged域內包裹呼叫using,如下範例所示:

using (BlockReentrancy())
{
    // OnCollectionChanged call
}
Using BlockReentrancy()
    ' OnCollectionChanged call
End Using

適用於

另請參閱