コレクションに指定した CodeAttributeArgument が格納されているかどうかを示す値を取得します。
Public Function Contains( _
ByVal value As CodeAttributeArgument _) As Boolean
[C#]
public bool Contains(CodeAttributeArgumentvalue);
[C++]
public: bool Contains(CodeAttributeArgument* value);
[JScript]
public function Contains(
value : CodeAttributeArgument) : Boolean;
パラメータ
- value
コレクション内で検索される CodeAttributeArgument 。
戻り値
コレクションに指定したオブジェクトが格納されている場合は true 。それ以外の場合は false 。
使用例
' 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
[C#]
// 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 );
[C++]
// Tests for the presence of a CodeAttributeArgument
// within the collection, and retrieves its index if it is found.
CodeAttributeArgument* testArgument = new CodeAttributeArgument(S"Test Boolean Argument", new CodePrimitiveExpression(__box(true)));
int itemIndex = -1;
if( collection->Contains( testArgument ) )
itemIndex = collection->IndexOf( testArgument );
[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン をクリックします。
必要条件
プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ
参照
CodeAttributeArgumentCollection クラス | CodeAttributeArgumentCollection メンバ | System.CodeDom 名前空間