TabletDeviceCollection.IsSynchronized Propriedade

Definição

Obtém um valor que indica se o acesso à coleção é sincronizado (thread-safe).

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

Valor da propriedade

true se o acesso à coleção for sincronizado (thread safe); caso contrário, false. O padrão é false.

Implementações

Exemplos

O exemplo a seguir demonstra a IsSynchronized propriedade .

// 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

Aplica-se a