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
Dolgozzon együtt velünk a GitHubon
A tartalom forrása a GitHubon található, ahol létrehozhat és áttekinthet problémákat és lekéréses kérelmeket is. További információért tekintse meg a közreműködői útmutatónkat.