CodeTypeDeclarationCollection.Contains(CodeTypeDeclaration) 메서드

정의

컬렉션에 지정된 CodeTypeDeclaration 개체가 포함되어 있는지 여부를 나타내는 값을 가져옵니다.

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 컬렉션에서 검색할 개체입니다.

반품

true컬렉션에 지정된 개체가 포함되어 있으면 이고, 그렇지 않으면 . false

예제

다음 예제에서는 메서드를 사용하여 Contains 개체를 CodeTypeDeclaration 찾는 방법을 보여 줍니다 CodeTypeDeclarationCollection.

// 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

적용 대상

추가 정보