次の方法で共有


VCCodeNamespace.Location[vsCMWhere] Property

Definition

Returns the location of the object declaration.

public:
 property System::String ^ Location[Microsoft::VisualStudio::VCCodeModel::vsCMWhere] { System::String ^ get(Microsoft::VisualStudio::VCCodeModel::vsCMWhere Where); };
[System.Runtime.InteropServices.DispId(549)]
public string Location[Microsoft.VisualStudio.VCCodeModel.vsCMWhere Where = Microsoft.VisualStudio.VCCodeModel.vsCMWhere.vsCMWhereDefault] { [System.Runtime.InteropServices.DispId(549)] get; }
[<System.Runtime.InteropServices.DispId(549)>]
[<get: System.Runtime.InteropServices.DispId(549)>]
member this.Location(Microsoft.VisualStudio.VCCodeModel.vsCMWhere) : string
Public ReadOnly Property Location(Optional Where As vsCMWhere = Microsoft.VisualStudio.VCCodeModel.vsCMWhere.vsCMWhereDefault) As String

Parameters

Where
vsCMWhere

Optional. A vsCMWhere value specifying whether the location of the declaration or the definition is returned.

Property Value

The location of the object declaration.

Attributes

Examples

This example displays the file containing the declaration for each top-level code element.

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  

Remarks

See How to: Compile Example Code for Visual C++ Code Model Extensibility for information on how to compile and run this sample.

Applies to