共用方式為


VCCodeEnum.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 不支援索引屬性。

參數

屬性值

型別:System.String
物件宣告的位置。

備註

如需這個範例的編譯與執行等詳細資訊,請參閱 HOW TO:編譯 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 安全性

請參閱

參考

VCCodeEnum 介面

Microsoft.VisualStudio.VCCodeModel 命名空間