WeakEventManager.ReadLock 屬性

定義

在基礎資料表上建立讀取鎖定,並傳回 IDisposable

protected:
 property IDisposable ^ ReadLock { IDisposable ^ get(); };
protected IDisposable ReadLock { get; }
member this.ReadLock : IDisposable
Protected ReadOnly Property ReadLock As IDisposable

屬性值

IDisposable

物件,可用來在資料表成員上建立鎖定,然後以 using 建構適當處置。

備註

在衍生類別中 Item[] ,內含資料表的查詢應該一律發生在 子句內 using (ReadLock) { ... } ,但已位於寫入鎖定內的查詢除外。 如果您的類別支援更複雜的 AddListener 實作,需要超過 sourcelistener 的更多資料,並使用 Item[] 集合來儲存額外的資訊,則可能需要這些查詢。

適用於

另請參閱