مشاركة عبر


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)

Syntax

'إقرار
<GuidAttribute("4853EB51-640F-4A98-A6CF-B43C3ECFA8A5")> _
Public Interface VCCodeNamespace
'الاستخدام
Dim instance As VCCodeNamespace
[GuidAttribute("4853EB51-640F-4A98-A6CF-B43C3ECFA8A5")]
public interface VCCodeNamespace
[GuidAttribute(L"4853EB51-640F-4A98-A6CF-B43C3ECFA8A5")]
public interface class VCCodeNamespace
[<GuidAttribute("4853EB51-640F-4A98-A6CF-B43C3ECFA8A5")>]
type VCCodeNamespace =  interface end
public interface VCCodeNamespace

Remarks

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

ملاحظة

A large part of the functionality of this object is provided by the Visual Studio CodeNamespace object. For more information, see CodeNamespace 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 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

See Also

Reference

VCCodeNamespace Members

Microsoft.VisualStudio.VCCodeModel Namespace