Share via


EditPoint.CreateEditPoint 方法

在调用对象的位置创建并返回一个 EditPoint 对象。

命名空间:  EnvDTE
程序集:  EnvDTE(在 EnvDTE.dll 中)

语法

声明
Function CreateEditPoint As EditPoint
EditPoint CreateEditPoint()
EditPoint^ CreateEditPoint()
abstract CreateEditPoint : unit -> EditPoint
function CreateEditPoint() : EditPoint

返回值

类型:EnvDTE.EditPoint
EditPoint 对象。

备注

CreateEditPoint 在与调用对象相同的物理位置创建并返回一个新的 EditPoint 对象。 如果调用对象是 VirtualPoint,则所得到的 EditPointVirtualPoint 具有相同的 LineCharOffset 值。

示例

Sub CreateEditPointExample(ByVal dte As DTE2)

    ' Before running this example, open a text document.

    ' Append "Hello!" to the active document.
    Dim textDoc As TextDocument = _
        CType(dte.ActiveDocument.Object("TextDocument"), TextDocument)
    textDoc.EndPoint.CreateEditPoint().Insert("Hello!")

End Sub
public void CreateEditPointExample(DTE2 dte)
{
    // Before running this example, open a text document.

    // Append "Hello!" to the active document.
    TextDocument textDoc = 
        (TextDocument)dte.ActiveDocument.Object("TextDocument");
    textDoc.EndPoint.CreateEditPoint().Insert("Hello!");
}

.NET Framework 安全性

请参阅

参考

EditPoint 接口

EnvDTE 命名空间

其他资源

如何:编译和运行自动化对象模型代码示例