ValidatorCollection.SyncRoot-Eigenschaft
Ruft ein Objekt ab, mit dem die ValidatorCollection-Auflistung synchronisiert werden kann.
Namespace: System.Web.UI
Assembly: System.Web (in system.web.dll)
Syntax
'Declaration
Public ReadOnly Property SyncRoot As Object
'Usage
Dim instance As ValidatorCollection
Dim value As Object
value = instance.SyncRoot
public Object SyncRoot { get; }
public:
virtual property Object^ SyncRoot {
Object^ get () sealed;
}
/** @property */
public final Object get_SyncRoot ()
public final function get SyncRoot () : Object
Eigenschaftenwert
Das zum Synchronisieren der Auflistung verwendete Object.
Beispiel
Im folgenden Codebeispiel wird die Verwendung der SyncRoot-Eigenschaft veranschaulicht.
' 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))
// 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.
ValidatorCollection myCollection1 = get_Validators();
// Get 'IsReadOnly' property of 'ValidatorCollection'.
boolean readOnly_bool = myCollection1.get_IsReadOnly();
// Get 'IsSynchronized' property of 'ValidatorCollection'.
boolean synchronized_bool = myCollection1.get_IsSynchronized();
// Get a synchronized object of the 'ValidatorCollection'.
ValidatorCollection myCollection2 = (ValidatorCollection)(
myCollection1.get_SyncRoot());
myCollection1.Add(myCollection1.get_Item(0));
Plattformen
Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.
Versionsinformationen
.NET Framework
Unterstützt in: 2.0, 1.1, 1.0
Siehe auch
Referenz
ValidatorCollection-Klasse
ValidatorCollection-Member
System.Web.UI-Namespace