TabletDeviceCollection.IsSynchronized Propriedade

Definição

Recebe um valor que indica se o acesso à coleção está sincronizado (thread safe).

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

Valor de Propriedade

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

Implementações

Exemplos

O exemplo seguinte 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