ValidatorCollection.IsSynchronized プロパティ

定義

ValidatorCollection コレクションの同期がとられているかどうかを示す値を取得します。Gets a value that indicates whether the ValidatorCollection collection is synchronized.

public:
 property bool IsSynchronized { bool get(); };
public bool IsSynchronized { get; }
member this.IsSynchronized : bool
Public ReadOnly Property IsSynchronized As Boolean

プロパティ値

コレクションが同期をとられている場合は true。それ以外の場合は falsetrue if the collection is synchronized; otherwise, false.

実装

次のコード例は、プロパティIsSynchronizedの使用方法を示しています。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]);
' Get 'Validators' of the page to myCollection.
Dim myCollection1 As ValidatorCollection = Page.Validators
' Get 'IsReadOnly' property of 'ValidatorCollection'.
Dim readOnly_bool As Boolean = myCollection1.IsReadOnly

' Get 'IsSynchronized' property of 'ValidatorCollection'.
Dim synchronized_bool As Boolean = myCollection1.IsSynchronized

' Get a synchronized object of the 'ValidatorCollection'.
Dim myCollection2 As ValidatorCollection = CType(myCollection1.SyncRoot, ValidatorCollection)
myCollection1.Add(myCollection1(0))

注釈

コレクションが同期されている場合は、スレッドセーフです。If the collection is synchronized, it is thread safe.

適用対象

こちらもご覧ください