ValidatorCollection.IsSynchronized Property

 

Gets a value that indicates whether the ValidatorCollection collection is synchronized.

Namespace:   System.Web.UI
Assembly:  System.Web (in System.Web.dll)

public bool IsSynchronized { get; }

Property Value

Type: System.Boolean

true if the collection is synchronized; otherwise, false.

If the collection is synchronized, it is thread safe.

The following code example demonstrates using the IsSynchronized property.

// Get 'Validators' of the page to myCollection.
ValidatorCollection myCollection1 = Page.Validators;

// Get 'IsReadOnly' property of 'ValidatorCollection'.
bool readOnly_bool = myCollection1.IsReadOnly;

// Get 'IsSynchronized' property of 'ValidatorCollection'.
bool synchronized_bool = myCollection1.IsSynchronized;

// Get a synchronized object of the 'ValidatorCollection'.
ValidatorCollection myCollection2 = (ValidatorCollection)myCollection1.SyncRoot;
myCollection1.Add(myCollection1[0]);

.NET Framework
Available since 1.1
Return to top
Show: