CodeTypeDeclarationCollection.Contains(CodeTypeDeclaration) CodeTypeDeclarationCollection.Contains(CodeTypeDeclaration) CodeTypeDeclarationCollection.Contains(CodeTypeDeclaration) CodeTypeDeclarationCollection.Contains(CodeTypeDeclaration) Method

Определение

Получает значение, которое указывает, содержит ли коллекция заданный объект CodeTypeDeclaration.Gets a value that indicates whether the collection contains the specified CodeTypeDeclaration object.

public:
 bool Contains(System::CodeDom::CodeTypeDeclaration ^ value);
public bool Contains (System.CodeDom.CodeTypeDeclaration value);
member this.Contains : System.CodeDom.CodeTypeDeclaration -> bool
Public Function Contains (value As CodeTypeDeclaration) As Boolean

Параметры

value
CodeTypeDeclaration CodeTypeDeclaration CodeTypeDeclaration CodeTypeDeclaration

Объект CodeTypeDeclaration для поиска в коллекции.The CodeTypeDeclaration object to search for in the collection.

Возвраты

Значение true, если коллекция содержит указанный объект; в обратном случае — значение false.true if the collection contains the specified object; otherwise, false.

Примеры

В следующем примере показано, как использовать Contains метод для CodeTypeDeclaration поиска объекта в CodeTypeDeclarationCollection.The following example demonstrates how to use the Contains method to find a CodeTypeDeclaration object in a CodeTypeDeclarationCollection.

// 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 );
' 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

Применяется к

Дополнительно