次の方法で共有


CodeElements Interface

Definition

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

public interface class CodeElements : System::Collections::IEnumerable
[System.Runtime.InteropServices.Guid("0CFBC2B5-0D4E-11D3-8997-00C04F688DDE")]
[System.Runtime.InteropServices.TypeLibType(4160)]
public interface CodeElements : System.Collections.IEnumerable
[System.Runtime.InteropServices.Guid("0CFBC2B5-0D4E-11D3-8997-00C04F688DDE")]
public interface CodeElements : System.Collections.IEnumerable
[<System.Runtime.InteropServices.Guid("0CFBC2B5-0D4E-11D3-8997-00C04F688DDE")>]
[<System.Runtime.InteropServices.TypeLibType(4160)>]
type CodeElements = interface
    interface IEnumerable
[<System.Runtime.InteropServices.Guid("0CFBC2B5-0D4E-11D3-8997-00C04F688DDE")>]
type CodeElements = interface
    interface IEnumerable
Public Interface CodeElements
Implements IEnumerable
Derived
Attributes
Implements

Remarks

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.

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

Properties

Count

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

DTE

Gets the top-level extensibility object.

Parent

Gets the immediate parent object of a CodeElements collection.

Methods

CreateUniqueID(String, String)

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

GetEnumerator()

Returns an enumerator for items in the CodeElements collection.

Item(Object)

Returns a CodeElement object in a CodeElements collection.

Reserved1(Object)

Microsoft Internal Use Only.

Applies to