CodeCommentStatementCollection.Contains(CodeCommentStatement) Metódus
Definíció
Fontos
Egyes információk olyan, kiadás előtti termékekre vonatkoznak, amelyek a kiadásig még jelentősen módosulhatnak. A Microsoft nem vállal kifejezett vagy törvényi garanciát az itt megjelenő információért.
Olyan értéket kap, amely jelzi, hogy a gyűjtemény tartalmazza-e a megadott CodeCommentStatement objektumot.
public:
bool Contains(System::CodeDom::CodeCommentStatement ^ value);
public bool Contains(System.CodeDom.CodeCommentStatement value);
member this.Contains : System.CodeDom.CodeCommentStatement -> bool
Public Function Contains (value As CodeCommentStatement) As Boolean
Paraméterek
- value
- CodeCommentStatement
A CodeCommentStatement gyűjteményben keresendő.
Válaszok
trueha a gyűjtemény tartalmazza a megadott objektumot; egyéb esetben. false
Példák
Az alábbi példa egy adott Contains objektum jelenlétének keresésére használja a CodeCommentStatement metódust, és lekéri a talált indexértéket.
// Tests for the presence of a CodeCommentStatement in the
// collection, and retrieves its index if it is found.
CodeCommentStatement testComment = new CodeCommentStatement("Test comment");
int itemIndex = -1;
if( collection.Contains( testComment ) )
itemIndex = collection.IndexOf( testComment );
' Tests for the presence of a CodeCommentStatement in the
' collection, and retrieves its index if it is found.
Dim testComment As New CodeCommentStatement("Test comment")
Dim itemIndex As Integer = -1
If collection.Contains(testComment) Then
itemIndex = collection.IndexOf(testComment)
End If