CodeTypeReferenceCollection.IndexOf(CodeTypeReference) Metod
Definition
Viktigt
En del information gäller för förhandsversionen av en produkt och kan komma att ändras avsevärt innan produkten blir allmänt tillgänglig. Microsoft lämnar inga garantier, uttryckliga eller underförstådda, avseende informationen som visas här.
Hämtar indexet i samlingen för den angivna CodeTypeReference, om det finns i samlingen.
public:
int IndexOf(System::CodeDom::CodeTypeReference ^ value);
public int IndexOf(System.CodeDom.CodeTypeReference value);
member this.IndexOf : System.CodeDom.CodeTypeReference -> int
Public Function IndexOf (value As CodeTypeReference) As Integer
Parametrar
- value
- CodeTypeReference
Att CodeTypeReference hitta i samlingen.
Returer
Indexet för angivet CodeTypeReference i samlingen om det hittas, annars -1.
Exempel
// Tests for the presence of a CodeTypeReference in the
// collection, and retrieves its index if it is found.
CodeTypeReference testReference = new CodeTypeReference(typeof(bool));
int itemIndex = -1;
if( collection.Contains( testReference ) )
itemIndex = collection.IndexOf( testReference );
' Tests for the presence of a CodeTypeReference in the
' collection, and retrieves its index if it is found.
Dim testReference As New CodeTypeReference(GetType(Boolean))
Dim itemIndex As Integer = -1
If collection.Contains(testReference) Then
itemIndex = collection.IndexOf(testReference)
End If