VCCodeElements - интерфейс
A collection of objects (representing individual code elements) within one or more source files.
Пространство имен: Microsoft.VisualStudio.VCCodeModel
Сборка: Microsoft.VisualStudio.VCCodeModel (в Microsoft.VisualStudio.VCCodeModel.dll)
Синтаксис
'Декларация
<GuidAttribute("DF69B05E-2447-11D7-8BF6-00B0D03DAA06")> _
Public Interface VCCodeElements _
Implements CodeElements
'Применение
Dim instance As VCCodeElements
[GuidAttribute("DF69B05E-2447-11D7-8BF6-00B0D03DAA06")]
public interface VCCodeElements : CodeElements
[GuidAttribute(L"DF69B05E-2447-11D7-8BF6-00B0D03DAA06")]
public interface class VCCodeElements : CodeElements
public interface VCCodeElements extends CodeElements
Заметки
A VCCodeElements collection object is a collection of one or more VCCodeElement objects. Each object in the VCCodeElements collection object represents an individual code element (such as a definition or element of declarative syntax).
See How to: Compile Example Code for Visual C++ Code Model Extensibility for information on how to compile and run this sample.
Примеры
This example displays the names of all code element objects declared at the global namespace level of the existing project (alphabetically).
' Macro code.
Sub GetGlobalElements()
Dim vcCM As VCCodeModel
Dim vcElement As VCCodeElement
Dim vcElements as VCCodeElements
vcCM = DTE.Solution.Item(1).CodeModel
vcElements = vcCM.CodeElements
vcElements.Sort(vsCMSort.vsCMSortAlpha)
For Each vcElement In vcElements
MsgBox(vcElement.DisplayName)
Next
End Sub