Udostępnij za pośrednictwem


VCCodeEnum Interface

An object representing an enumeration code element in the source code of a solution.

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

Syntax

'Declaration
<GuidAttribute("17730D47-271F-11D7-8BF6-00B0D03DAA06")> _
Public Interface VCCodeEnum
'Usage
Dim instance As VCCodeEnum
[GuidAttribute("17730D47-271F-11D7-8BF6-00B0D03DAA06")]
public interface VCCodeEnum
[GuidAttribute(L"17730D47-271F-11D7-8BF6-00B0D03DAA06")]
public interface class VCCodeEnum
public interface VCCodeEnum

Remarks

A large part of the functionality of this object is provided by the Visual Studio CodeEnum object.

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

Examples

This example displays the variables used by the first enumeration of the CAboutDlg class. It assumes a CAboutDlg class exists and has enumerations.

Sub GetEnums()
    Dim vcCM As VCCodeModel
    Dim vcEnum As VCCodeEnum
    Dim vcVariable As VCCodeVariable
    vcCM = DTE.Solution.Item(1).CodeModel
    vcEnum = vcCM.Classes.Item("CAboutDlg").Enums.Item(1)
    For Each vcVariable In vcEnum.Members
        MsgBox(vcVariable.DisplayName)
    Next
End Sub

See Also

Reference

VCCodeEnum Members

Microsoft.VisualStudio.VCCodeModel Namespace