TabletDeviceCollection.IsSynchronized Propiedad

Definición

Obtiene un valor que indica si el acceso a la colección está sincronizado (es seguro para la ejecución de subprocesos).

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

Valor de propiedad

Es true si el acceso a la colección está sincronizado (seguro para subprocesos); de lo contrario, es false. De manera predeterminada, es false.

Implementaciones

Ejemplos

En el ejemplo siguiente se muestra la IsSynchronized propiedad .

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

Se aplica a