CodeTypeDeclarationCollection.Contains-Methode
Ruft einen Wert ab, der angibt, ob die Auflistung die angegebene CodeTypeDeclaration enthält.
Namespace: System.CodeDom
Assembly: System (in system.dll)
Syntax
'Declaration
Public Function Contains ( _
value As CodeTypeDeclaration _
) As Boolean
'Usage
Dim instance As CodeTypeDeclarationCollection
Dim value As CodeTypeDeclaration
Dim returnValue As Boolean
returnValue = instance.Contains(value)
public bool Contains (
CodeTypeDeclaration value
)
public:
bool Contains (
CodeTypeDeclaration^ value
)
public boolean Contains (
CodeTypeDeclaration value
)
public function Contains (
value : CodeTypeDeclaration
) : boolean
Parameter
- value
Die CodeTypeDeclaration, die in der Auflistung gesucht werden soll.
Rückgabewert
true, wenn die Auflistung das angegebene Objekt enthält, andernfalls false.
Beispiel
' Tests for the presence of a CodeTypeDeclaration in the
' collection, and retrieves its index if it is found.
Dim testDeclaration As New CodeTypeDeclaration("TestType")
Dim itemIndex As Integer = -1
If collection.Contains(testDeclaration) Then
itemIndex = collection.IndexOf(testDeclaration)
End If
// Tests for the presence of a CodeTypeDeclaration in the
// collection, and retrieves its index if it is found.
CodeTypeDeclaration testDeclaration = new CodeTypeDeclaration("TestType");
int itemIndex = -1;
if( collection.Contains( testDeclaration ) )
itemIndex = collection.IndexOf( testDeclaration );
// Tests for the presence of a CodeTypeDeclaration in the
// collection, and retrieves its index if it is found.
CodeTypeDeclaration^ testDeclaration = gcnew CodeTypeDeclaration( "TestType" );
int itemIndex = -1;
if ( collection->Contains( testDeclaration ) )
itemIndex = collection->IndexOf( testDeclaration );
// Tests for the presence of a CodeTypeDeclaration in the
// collection, and retrieves its index if it is found.
CodeTypeDeclaration testDeclaration = new
CodeTypeDeclaration("TestType");
int itemIndex = -1;
if (collection.Contains(testDeclaration)) {
itemIndex = collection.IndexOf(testDeclaration);
}
Plattformen
Windows 98, Windows 2000 SP4, Windows Millennium Edition, 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
CodeTypeDeclarationCollection-Klasse
CodeTypeDeclarationCollection-Member
System.CodeDom-Namespace
IndexOf