Поделиться через


VCCodeAttribute.Location Property

Returns the location of the parent object declaration.

Namespace:  Microsoft.VisualStudio.VCCodeModel
Assembly:  Microsoft.VisualStudio.VCCodeModel (in Microsoft.VisualStudio.VCCodeModel.dll)

Syntax

'Декларация
ReadOnly Property Location ( _
    Where As vsCMWhere _
) As String
    Get
string this[
    vsCMWhere Where
] { get; }
property String^ Location[[InAttribute] vsCMWhere Where] {
    String^ get ([InAttribute] vsCMWhere Where);
}
abstract Location : string
JScript does not support indexed properties.

Parameters

Property Value

Type: System.String
The location of the parent object declaration.

Remarks

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 displays the file containing the declaration for each top-level code element.

' Macro code.
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 Security

See Also

Reference

VCCodeAttribute Interface

Microsoft.VisualStudio.VCCodeModel Namespace