指定した CodeExpression がコレクションに格納されているかどうかを示す値を取得します。
名前空間: System.CodeDom
アセンブリ: System (system.dll 内)
構文
'宣言
Public Function Contains ( _
value As CodeExpression _
) As Boolean
'使用
Dim instance As CodeExpressionCollection
Dim value As CodeExpression
Dim returnValue As Boolean
returnValue = instance.Contains(value)
public bool Contains (
CodeExpression value
)
public:
bool Contains (
CodeExpression^ value
)
public boolean Contains (
CodeExpression value
)
public function Contains (
value : CodeExpression
) : boolean
パラメータ
- value
コレクション内で検索される CodeExpression。
戻り値
コレクションに指定したオブジェクトが格納されている場合は true。それ以外の場合は false。
使用例
' Tests for the presence of a CodeExpression in the
' collection, and retrieves its index if it is found.
Dim testComment = New CodePrimitiveExpression(True)
Dim itemIndex As Integer = -1
If collection.Contains(testComment) Then
itemIndex = collection.IndexOf(testComment)
End If
// Tests for the presence of a CodeExpression in the
// collection, and retrieves its index if it is found.
CodeExpression testComment = new CodePrimitiveExpression(true);
int itemIndex = -1;
if( collection.Contains( testComment ) )
itemIndex = collection.IndexOf( testComment );
// Tests for the presence of a CodeExpression in the
// collection, and retrieves its index if it is found.
CodeExpression^ testComment = gcnew CodePrimitiveExpression( true );
int itemIndex = -1;
if ( collection->Contains( testComment ) )
itemIndex = collection->IndexOf( testComment );
// Tests for the presence of a CodeExpression in the
// collection, and retrieves its index if it is found.
CodeExpression testComment = new CodePrimitiveExpression(System.
Convert.ToString(true));
int itemIndex = -1;
if (collection.Contains(testComment)) {
itemIndex = collection.IndexOf(testComment);
}
プラットフォーム
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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
バージョン情報
.NET Framework
サポート対象 : 2.0、1.1、1.0
参照
関連項目
CodeExpressionCollection クラス
CodeExpressionCollection メンバ
System.CodeDom 名前空間
IndexOf