ParserErrorCollection.Contains メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > ParserErrorCollection.Contains メソッドの意味・解説 

ParserErrorCollection.Contains メソッド

メモ : このメソッドは、.NET Framework version 2.0新しく追加されたものです。

ParserError オブジェクトコレクション内にあるかどうか判断します

名前空間: System.Web
アセンブリ: System.Web (system.web.dll 内)
構文構文

Public Function Contains ( _
    value As ParserError _
) As Boolean
Dim instance As ParserErrorCollection
Dim value As ParserError
Dim returnValue As Boolean

returnValue = instance.Contains(value)
public bool Contains (
    ParserError value
)
public:
bool Contains (
    ParserError^ value
)
public boolean Contains (
    ParserError value
)
public function Contains (
    value : ParserError
) : boolean

パラメータ

value

コレクションで検索する ParserError。

戻り値
ParserErrorコレクション内に存在する場合trueそれ以外場合false

解説解説

同じ ParserError オブジェクトコレクション複数追加することはできません。ただし、ParserError オブジェクトを 2 回以上追加しようとして例外スローされません。代わりに追加失敗します。この場合Add メソッドは –1 を返します。しかし、AddRange メソッドInsert メソッドには戻り値がありません。これらのメソッドいずれか使用して ParserError オブジェクト追加する場合は、Contains メソッド使用して特定の ParserError オブジェクトが既にコレクション存在するかどうか確認します

使用例使用例

ParserErrorCollection オブジェクト内の指定した ParserError オブジェクト検索する方法次のコード例示します

' Test for the presence of a ParserError in the 
' collection, and retrieve its index if it is found.
Dim testError As New ParserError("Error",
 "Path", 1)
Dim itemIndex As Integer
 = -1
If collection.Contains(testError) Then
  itemIndex = collection.IndexOf(testError)
End If
// Test for the presence of a ParserError in the 
// collection, and retrieve its index if it is found.
ParserError testError = new ParserError("Error", "Path",
 1);
int itemIndex = -1;
if (collection.Contains(testError))
  itemIndex = collection.IndexOf(testError);
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
ParserErrorCollection クラス
ParserErrorCollection メンバ
System.Web 名前空間



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

ParserErrorCollection.Contains メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



ParserErrorCollection.Contains メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS