TX Text Control .NET for Windows Forms

SyncRoot Property

Property|Introduced in 26.0
Explicit
Implements System.Collections.ICollection explicitly: cast to the interface to use it.
Namespace
TXTextControl
Package
TXTextControl.TextControl.WinForms.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 uses the collection's synchronization root while creating an audit snapshot.

ICollection collection = textControl.TrackedChanges;
lock (collection.SyncRoot)
{
    Console.WriteLine($"Tracked changes: {collection.Count}");
}

Limitations

Read only.