Partager via


CodeElements.Item(Object) Method

Definition

Returns a CodeElement object in a CodeElements collection.

public:
 EnvDTE::CodeElement ^ Item(System::Object ^ index);
public:
 EnvDTE::CodeElement ^ Item(Platform::Object ^ index);
EnvDTE::CodeElement Item(winrt::Windows::Foundation::IInspectable const & index);
[System.Runtime.InteropServices.DispId(0)]
public EnvDTE.CodeElement Item (object index);
[<System.Runtime.InteropServices.DispId(0)>]
abstract member Item : obj -> EnvDTE.CodeElement
Public Function Item (index As Object) As CodeElement

Parameters

index
Object

Required. The index of the CodeElement object to return.

Returns

A CodeElement object.

Attributes

Remarks

The Item method throws a ArgumentException exception if the collection cannot find the object that corresponds to the index value.

Note

The values of code model elements such as classes, structs, functions, attributes, delegates, and so forth can be non-deterministic after making certain kinds of edits, meaning that their values cannot be relied upon to always remain the same. For more information, see the section Code Model Element Values Can Change in Discovering Code by Using the Code Model (Visual Basic).

Applies to