VCCodeIDLCoClass.StartPointOf[vsCMPart, vsCMWhere] 屬性

定義

取得物件的起點。Gets the start point of the object.

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)]
[get: System.Runtime.InteropServices.DispId(550)]
[get: System.Runtime.InteropServices.TypeLibFunc(System.Runtime.InteropServices.TypeLibFuncFlags.FNonBrowsable)]
public EnvDTE.TextPoint StartPointOf[EnvDTE.vsCMPart Part, Microsoft.VisualStudio.VCCodeModel.vsCMWhere Where = Microsoft.VisualStudio.VCCodeModel.vsCMWhere.vsCMWhereDefault] { 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

必要。Required. vsCMPart 值,指定要使用定義或宣告的哪個部分 (屬性區塊、主體等等)。A vsCMPart value specifying which part of the definition or the declaration to use (attributes block, body, and so on).

Where
vsCMWhere

選擇性。Optional. vsCMWhere 值,指定 TextPoint 物件是定義或宣告。A vsCMWhere value specifying whether the TextPoint object is the definition or the declaration.

屬性值

TextPoint

TextPoint 物件。A TextPoint object.

屬性

範例

此範例會在程式碼專案宣告的開頭新增批註。This example adds a comment at the beginning of a code element declaration.

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 + + 程式碼模型 擴充性的範例程式碼,以取得如何編譯和執行此範例的相關資訊。See How to: Compile Example Code for Visual C++ Code Model Extensibility for information on how to compile and run this sample.

適用於