CodeElements Interface

 

A collection of objects representing code constructs in a source file.

Namespace:   EnvDTE
Assembly:  EnvDTE (in EnvDTE.dll)

[GuidAttribute("0CFBC2B5-0D4E-11D3-8997-00C04F688DDE")]
public interface CodeElements : IEnumerable

NameDescription
System_CAPS_pubpropertyCount

Gets a value indicating the number of objects in the CodeElements collection.

System_CAPS_pubpropertyDTE

Gets the top-level extensibility object.

System_CAPS_pubpropertyParent

Gets the immediate parent object of a CodeElements collection.

NameDescription
System_CAPS_pubmethodCreateUniqueID(String, String)

Creates a programmatic identifier that does not collide with other identifiers in the scope and that follows the current language naming rules.

System_CAPS_pubmethodGetEnumerator()

Returns an enumerator for items in the CodeElements collection.

System_CAPS_pubmethodItem(Object)

Returns a CodeElement object in a CodeElements collection.

System_CAPS_pubmethodReserved1(Object)

This API supports the product infrastructure and is not intended to be used directly from your code. Microsoft Internal Use Only.

CodeElements contains all elements in source files, members of classes, and so forth. It is automatically updated if an item is added to or removed from an open document or through the code model.

You can navigate through code elements using ProjectItem.FileCodeModel.CodeElements.

System_CAPS_noteNote

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).

Return to top
Show: