TX Text Control .NET for WPF

IsSynchronized Property

Property|Introduced in 23.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

Returns true if the collection is designed to be thread safe, otherwise, it returns false.

Syntax

The type implements this member of System.Collections.ICollection explicitly: code reaches it by casting to the interface, as in ((ICollection)value).IsSynchronized.

bool ICollection.IsSynchronized { get; }

Examples

The following example checks whether access to the named-region collection is synchronized.

ICollection collection = textControl.SubTextParts;
if (!collection.IsSynchronized)
{
    lock (collection.SyncRoot)
    {
        Console.WriteLine($"Named regions: {collection.Count}");
    }
}

Limitations

Read only.