VCCodeMacro.Location 属性

获取对象声明的位置。

命名空间:  Microsoft.VisualStudio.VCCodeModel
程序集:  Microsoft.VisualStudio.VCCodeModel(在 Microsoft.VisualStudio.VCCodeModel.dll 中)

语法

声明
ReadOnly Property Location ( _
    Where As vsCMWhere _
) As String
string this[
    vsCMWhere Where
] { get; }
property String^ Location[[InAttribute] vsCMWhere Where] {
    String^ get ([InAttribute] vsCMWhere Where);
}
abstract Location : 
        Where:vsCMWhere -> string with get
JScript 不支持索引属性。

参数

属性值

类型:String
对象声明的位置。

备注

有关如何编译和运行此示例的信息,请参见 如何:编译 Visual C++ 代码模型扩展性的示例代码

示例

此示例显示包含每个顶级代码元素的文件中声明。

Sub DisplayLocation()
    Dim vcCM As VCCodeModel
    Dim vcCodeElement As VCCodeElement
    vcCM = DTE.Solution.Item(1).CodeModel
    For Each vcCodeElement In vcCM.CodeElements
        MsgBox(vcCodeElement.Name + " is declared in " + vcCodeElement.Location)
    Next
End Sub

.NET Framework 安全性

请参阅

参考

VCCodeMacro 接口

Microsoft.VisualStudio.VCCodeModel 命名空间