CodeTypeReferenceCollection.IndexOf(CodeTypeReference) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the index in the collection of the specified CodeTypeReference, if it exists in the collection.
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
Parameters
- value
- CodeTypeReference
The CodeTypeReference to locate in the collection.
Returns
The index of the specified CodeTypeReference in the collection if found; otherwise, -1.
Examples
// Tests for the presence of a CodeTypeReference in the
// collection, and retrieves its index if it is found.
CodeTypeReference^ testReference = gcnew CodeTypeReference( bool::typeid );
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.
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
Applies to
See also
ทํางานร่วมกับเราใน GitHub
แหล่งที่มาสำหรับเนื้อหานี้สามารถพบได้บน GitHub ซึ่งคุณยังสามารถสร้างและตรวจสอบปัญหาและคำขอดึงข้อมูลได้ สำหรับข้อมูลเพิ่มเติม ให้ดูคู่มือผู้สนับสนุนของเรา