Export (0) Print
Expand All

VCCodeBase Interface 

An object providing access to the base class list of the parent object.

Namespace: Microsoft.VisualStudio.VCCodeModel
Assembly: Microsoft.VisualStudio.VCCodeModel (in microsoft.visualstudio.vccodemodel.dll)

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

The VCCodeBase object provides access to the code element representing the base class list for the parent object, if it exists. You can use this object to retrieve the base class or classes that exist for the parent object.

NoteNote

This does not represent the actual base class code element. It simply represents the base class names for the parent object.

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

This example displays the base classes for each class in the current project.

    Sub GetBases()
        Dim vcCM As VCCodeModel
        Dim vcClass As VCCodeClass
        Dim vcBase As VCCodeBase
        Dim i As Integer
        vcCM = DTE.Solution.Item(1).CodeModel
        For Each vcClass In vcCM.Classes
            For i = 1 To vcClass.Bases.Count
                vcBase = vcClass.Bases.Item(1)
                MsgBox(vcClass.Name + " derives from " + vcBase.Name)
            Next
        Next
    End Sub
Show:
© 2014 Microsoft