Export (0) Print
Expand All

VCCodeNamespace Interface 

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

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

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

The VCCodeNamespace object represents namespace declarations and is a superset of the VCCodeElement object.

NoteNote

A large part of the functionality of this object is provided by the Visual Studio CodeNamespace object. For more information, see CodeNamespace object.

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

This example retrieves the namespaces of the current solution and displays each name in a message box.

Sub AllNamespaces()
    Dim codeModel As VCCodeModel
    codeModel = DTE.Solution.Item(1).CodeModel
    Dim namespace As VCCodeNamespace
    For Each namespace In codeModel.Namespaces
        MsgBox(namespace.DisplayName)
    Next
End Sub
Show:
© 2014 Microsoft