TX Text Control .NET for WPF

SyncRoot Property

Property|Introduced in 29.0
Explicit
Implements System.Collections.ICollection explicitly: cast to the interface to use it.
Namespace
TXTextControl
Package
TXTextControl.TextControl.WPF.SDK as TXTextControl.dll from the private NuGet feed or Text Control Offline Packages

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; }

Examples

The following example works with tables of contents in the current document by using TableOfContentsCollection.syncroot.

textControl.Text = "Customer: Contoso Ltd.";
textControl.Select(10, 12);
TableOfContentsCollection tableOfContentsCollection = textControl.TablesOfContents;
tableOfContentsCollection.Add(new TableOfContents(1, 3) { Name = "Contents", ID = 100 });

ICollection collection = tableOfContentsCollection;
var value = collection.SyncRoot;

Limitations

Read only.