CodeCommentStatementCollection.Contains(CodeCommentStatement) Método
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Recebe um valor que indica se a coleção contém o objeto especificado CodeCommentStatement .
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
Parâmetros
- value
- CodeCommentStatement
A CodeCommentStatement procurar na coleção.
Devoluções
true se a coleção contiver o objeto especificado; caso contrário, false.
Exemplos
O exemplo seguinte utiliza o Contains método para procurar a presença de um objeto específico CodeCommentStatement e obtém o valor do índice em que foi encontrado.
// 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