This documentation is archived and is not being maintained.

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)

[GuidAttribute("17730D47-271F-11D7-8BF6-00B0D03DAA06")] 
public interface VCCodeEnum
/** @attribute GuidAttribute("17730D47-271F-11D7-8BF6-00B0D03DAA06") */ 
public interface VCCodeEnum
GuidAttribute("17730D47-271F-11D7-8BF6-00B0D03DAA06") 
public interface VCCodeEnum

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

See Samples for Code Model Extensibility for information on how to compile and run this sample.

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
Show: