VCCodeElements::Item Method (Object^)

 

Returns the specified code element of the parent object.

Namespace:   Microsoft.VisualStudio.VCCodeModel
Assembly:  Microsoft.VisualStudio.VCCodeModel (in Microsoft.VisualStudio.VCCodeModel.dll)

CodeElement^ Item(
	Object^ index
)

Parameters

index
Type: System::Object^

An object representing the location of an item in the collection.

Return Value

Type: EnvDTE::CodeElement^

A CodeElement object.

If the specified code element was not found, the method returns null.

See How to: Compile Example Code for Visual C++ Code Model Extensibility for information on how to compile and run this sample.

' Macro code.
' Displays the name of all the top level elements.
    Sub FindItem()
        Dim vcCM As VCCodeModel
        Dim vcCodeElements As VCCodeElements
        vcCM = DTE.Solution.Item(1).CodeModel
        vcCodeElements = vcCM.CodeElements
        Dim i As Integer
        For i = 1 To vcCodeElements.Count
            MsgBox(vcCodeElements.Item(i))
        Next
    End Sub
Return to top
Show: