SyncRoot Property
- Explicit
- Implements
System.explicitly: cast to the interface to use it.Collections. ICollection
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. WPF. SDK TXTextControl.from the private NuGet feed or Text Control Offline Packagesdll
Description
Gets an object that can be used to synchronize access to the collection.
Syntax
The type implements this member of System.Collections.ICollection explicitly: code reaches it by casting to the interface, as in ((ICollection)value).SyncRoot.
object ICollection.SyncRoot { get; }Private ReadOnly Property SyncRoot As Object Implements ICollection.SyncRootExamples
The following example works with document targets in the current document by using DocumentTargetCollection.syncroot.
textControl.Text = "Customer: Contoso Ltd.";
textControl.Select(10, 12);
DocumentTargetCollection documentTargetCollection = textControl.DocumentTargets;
documentTargetCollection.Add(new DocumentTarget("CustomerDetails") { ID = 100 });
ICollection collection = documentTargetCollection;
var value = collection.SyncRoot;textControl.Text = "Customer: Contoso Ltd."
textControl.Select(10, 12)
Dim documentTargetCollection As DocumentTargetCollection = textControl.DocumentTargets
documentTargetCollection.Add(New DocumentTarget("CustomerDetails") With { .ID = 100 })
Dim collection As ICollection = documentTargetCollection
Dim value = collection.SyncRootLimitations
Read only.