IsSynchronized Property
- Explicit
- Implements
System.explicitly: cast to the interface to use it.Collections. ICollection
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. WinForms. SDK TXTextControl.from the private NuGet feed or Text Control Offline Packagesdll
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; }Private ReadOnly Property IsSynchronized As Boolean Implements ICollection.IsSynchronizedExamples
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}");
}
}Dim collection As ICollection = textControl.SubTextParts
If Not collection.IsSynchronized Then
SyncLock collection.SyncRoot
Console.WriteLine($"Named regions: {collection.Count}")
End SyncLock
End IfLimitations
Read only.