返回对象声明的位置。
命名空间:  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 不支持索引属性。
参数
- Where
类型:Microsoft.VisualStudio.VCCodeModel.vsCMWhere
可选。一个 vsCMWhere 值,指定是返回声明的位置还是定义的位置。 
属性值
类型:System.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 安全性
- 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关更多信息,请参见通过部分受信任的代码使用库。