EditPoint2.AtEndOfDocument 属性

获取一个值,该值指示对象是否位于文档的结尾。

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

语法

声明
ReadOnly Property AtEndOfDocument As Boolean
    Get
bool AtEndOfDocument { get; }
property bool AtEndOfDocument {
    bool get ();
}
abstract AtEndOfDocument : bool
function get AtEndOfDocument () : boolean

属性值

类型:System.Boolean
一个布尔值,如果位于文档的结尾,该值为 true;否则为 false。

实现

EditPoint.AtEndOfDocument

示例

Sub AtEndOfDocumentExample(ByVal dte As DTE2)

    ' Create a new text file.
    dte.ItemOperations.NewFile()

    ' Create an EditPoint at the start of the new document.
    Dim doc As TextDocument = _
        CType(dte.ActiveDocument.Object("TextDocument"), TextDocument)
    Dim point As EditPoint = doc.StartPoint.CreateEditPoint

    Dim i As Integer

    ' Insert 10 lines of text.
    For i = 1 To 10
        point.Insert("This is a test." & vbCrLf)
    Next

    ' Display EditPoint properties.
    MsgBox( _
        "AbsoluteCharOffset: " & point.AbsoluteCharOffset & vbCrLf & _
        "AtEndOfDocument: " & point.AtEndOfDocument & vbCrLf & _
        "AtEndOfLine: " & point.AtEndOfLine & vbCrLf & _
        "AtStartOfDocument: " & point.AtStartOfDocument & vbCrLf & _
        "AtStartOfLine: " & point.AtStartOfLine)

End Sub
public void AtEndOfDocumentExample(DTE2 dte)
{
    // Create a new text file.
    dte.ItemOperations.NewFile(@"General\Text File", "", 
        Constants.vsViewKindPrimary);

    // Create an EditPoint at the start of the new document.
    TextDocument doc = 
        (TextDocument)dte.ActiveDocument.Object("TextDocument");
    EditPoint point = doc.StartPoint.CreateEditPoint();

    // Insert 10 lines of text.
    for (int i = 1; i <= 10; ++i)
        point.Insert("This is a test.\n");

    // Display EditPoint properties.
    MessageBox.Show(
        "AbsoluteCharOffset: " + point.AbsoluteCharOffset + "\n" +
        "AtEndOfDocument: " + point.AtEndOfDocument + "\n" +
        "AtEndOfLine: " + point.AtEndOfLine + "\n" +
        "AtStartOfDocument: " + point.AtStartOfDocument + "\n" +
        "AtStartOfLine: " + point.AtStartOfLine);
}

.NET Framework 安全性

请参见

参考

EditPoint2 接口

AtEndOfDocument 重载

EnvDTE80 命名空间

其他资源

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