VCCodeStruct::Location Property (vsCMWhere)
Visual Studio 2015
Returns the location of the object declaration.
Assembly: Microsoft.VisualStudio.VCCodeModel (in Microsoft.VisualStudio.VCCodeModel.dll)
property String^ default[ vsCMWhere Where = vsCMWhere::vsCMWhereDefault ] { String^ get(vsCMWhere Where = vsCMWhere::vsCMWhereDefault); }
Parameters
- Where
-
Type:
Microsoft.VisualStudio.VCCodeModel::vsCMWhere
Optional. A vsCMWhere value specifying whether the location of the declaration or the definition is returned.
This example displays the file containing the declaration for each top-level code element.
[Visual Basic]
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
Show: