CodeAttributeArgumentCollection.IndexOf(CodeAttributeArgument) 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.
Obtém o índice do objeto especificado CodeAttributeArgument na coleção, se este existir na coleção.
public:
int IndexOf(System::CodeDom::CodeAttributeArgument ^ value);
public int IndexOf(System.CodeDom.CodeAttributeArgument value);
member this.IndexOf : System.CodeDom.CodeAttributeArgument -> int
Public Function IndexOf (value As CodeAttributeArgument) As Integer
Parâmetros
- value
- CodeAttributeArgument
O CodeAttributeArgument objeto a localizar na coleção.
Devoluções
O índice do objeto especificado, se encontrado, na coleção; caso contrário, -1.
Exemplos
O exemplo seguinte procura a presença de um objeto específico CodeAttributeArgument e utiliza o IndexOf método para obter o valor do índice em que foi encontrado.
// 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 );
' 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