TabletDeviceCollection.IsSynchronized Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets a value that indicates whether access to the collection is synchronized (thread safe).
public:
property bool IsSynchronized { bool get(); };
public bool IsSynchronized { get; }
member this.IsSynchronized : bool
Public ReadOnly Property IsSynchronized As Boolean
Property Value
true
if access to the collection is synchronized (thread safe); otherwise, false
. The default is false
.
Implements
Examples
The following example demonstrates the IsSynchronized property.
// 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
Applies to
Colaborați cu noi pe GitHub
Sursa pentru acest conținut poate fi găsită pe GitHub, unde puteți, de asemenea, să creați și să consultați probleme și solicitări de tragere. Pentru mai multe informații, consultați ghidul nostru pentru colaboratori.