CodeAttributeArgumentCollection.Contains(CodeAttributeArgument) 메서드

정의

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

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

매개 변수

value
CodeAttributeArgument

CodeAttributeArgument 컬렉션에서 찾을 개체입니다.

반품

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

예제

다음 예제에서는 메서드를 Contains 사용하여 특정 CodeAttributeArgument 개체의 존재를 검색하고 해당 개체 CodeAttributeArgumentCollection 가 발견된 인덱스 값을 가져옵니다.

// Tests for the presence of a CodeAttributeArgument
// within the collection, and retrieves its index if it is found.
CodeAttributeArgument testArgument = new CodeAttributeArgument("Test Boolean Argument", new CodePrimitiveExpression(true));
int itemIndex = -1;
if( collection.Contains( testArgument ) )
    itemIndex = collection.IndexOf( testArgument );
' Tests for the presence of a CodeAttributeArgument in 
' the collection, and retrieves its index if it is found.
Dim testArgument As New CodeAttributeArgument("Test Boolean Argument", New CodePrimitiveExpression(True))
Dim itemIndex As Integer = -1
If collection.Contains(testArgument) Then
    itemIndex = collection.IndexOf(testArgument)
End If

적용 대상