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
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.