TabletDeviceCollection.IsSynchronized Eigenschap

Definitie

Hiermee wordt een waarde opgehaald die aangeeft of de toegang tot de verzameling is gesynchroniseerd (thread veilig).

public:
 property bool IsSynchronized { bool get(); };
public bool IsSynchronized { get; }
member this.IsSynchronized : bool
Public ReadOnly Property IsSynchronized As Boolean

Waarde van eigenschap

true als de toegang tot de verzameling wordt gesynchroniseerd (thread veilig); anders, false. De standaardwaarde is false.

Implementeringen

Voorbeelden

In het volgende voorbeeld ziet u de IsSynchronized eigenschap.

// Is the collection thread safe?        
if (!myTabletDeviceCollection.IsSynchronized)
{
    // If not, use SyncRoot to lock access
    lock (myTabletDeviceCollection.SyncRoot)
    {
        // work with collection
    }
}
'  Is the collection thread safe?
If Not myTabletDeviceCollection.IsSynchronized Then
    ' If not, use SyncRoot to lock access
    SyncLock myTabletDeviceCollection.SyncRoot
        ' work with collection
    End SyncLock
End If

Van toepassing op