VCCodeDelegate.StartPointOf[vsCMPart, vsCMWhere] 属性

定义

获取父对象的起点。

public:
 property EnvDTE::TextPoint ^ StartPointOf[EnvDTE::vsCMPart, Microsoft::VisualStudio::VCCodeModel::vsCMWhere] { EnvDTE::TextPoint ^ get(EnvDTE::vsCMPart Part, Microsoft::VisualStudio::VCCodeModel::vsCMWhere Where); };
[System.Runtime.InteropServices.DispId(550)]
public EnvDTE.TextPoint StartPointOf[EnvDTE.vsCMPart Part, Microsoft.VisualStudio.VCCodeModel.vsCMWhere Where = Microsoft.VisualStudio.VCCodeModel.vsCMWhere.vsCMWhereDefault] { [System.Runtime.InteropServices.DispId(550)] [System.Runtime.InteropServices.TypeLibFunc(System.Runtime.InteropServices.TypeLibFuncFlags.FNonBrowsable)] get; }
[<System.Runtime.InteropServices.DispId(550)>]
[<get: System.Runtime.InteropServices.DispId(550)>]
[<get: System.Runtime.InteropServices.TypeLibFunc(System.Runtime.InteropServices.TypeLibFuncFlags.FNonBrowsable)>]
member this.StartPointOf(EnvDTE.vsCMPart * Microsoft.VisualStudio.VCCodeModel.vsCMWhere) : EnvDTE.TextPoint
Public ReadOnly Property StartPointOf(Part As vsCMPart, Optional Where As vsCMWhere = Microsoft.VisualStudio.VCCodeModel.vsCMWhere.vsCMWhereDefault) As TextPoint

参数

Part
vsCMPart

必需。 一个 vsCMPart 值,指定使用定义或声明的哪一部分(特性块、正文等等)。

Where
vsCMWhere

可选。 一个 vsCMWhere 值,指定 TextPoint 对象是定义还是声明。

属性值

TextPoint

TextPoint 对象。

属性

示例

此示例在代码元素声明的开头添加注释。

[Visual Basic]

Sub AddCommentAtBeginning()  
    Dim vcElement As VCCodeElement  
    Dim vcElements As VCCodeElements  
    Dim textPoint As TextPoint  
    vcElements = DTE.Solution.Item(1).CodeModel.Classes  
    vcElement = vcElements.Item(1)  
    textPoint = vcElement.StartPointOf(vsCMPart.vsCMPartWhole)  
    textPoint.CreateEditPoint().Insert("/*Comment*/")  
End Sub  

注解

有关如何编译和运行此示例的信息,请参阅 如何:编译 Visual C++ 代码模型扩展性的示例代码

适用于