TabletDeviceCollection.SyncRoot Property

 

Gets an object that can be used to synchronize access to the collection.

Namespace:   System.Windows.Input
Assembly:  PresentationCore (in PresentationCore.dll)

public object SyncRoot { get; }

Property Value

Type: System.Object

An object that can be used to synchronize access to the collection.

The following example demonstrates the SyncRoot property.

// Is the collection thread safe?        
if (!myTabletDeviceCollection.IsSynchronized)
{
    // If not, use SyncRoot to lock access
    lock (myTabletDeviceCollection.SyncRoot)
    {
        // work with collection
    }
}

.NET Framework
Available since 3.0
Return to top
Show: