EditPoint.LineCharOffset Eigenschaft

Definition

Gibt den Zeichenoffset des EditPoint-Objekts zurück.Gets the character offset of the EditPoint object.

public:
 property int LineCharOffset { int get(); };
public:
 property int LineCharOffset { int get(); };
[System.Runtime.InteropServices.DispId(12)]
[get: System.Runtime.InteropServices.DispId(12)]
public int LineCharOffset { get; }
[<System.Runtime.InteropServices.DispId(12)>]
[<get: System.Runtime.InteropServices.DispId(12)>]
member this.LineCharOffset : int
Public ReadOnly Property LineCharOffset As Integer

Eigenschaftswert

Int32

Ein ganzzahliger Wert, der das Zeichenoffset des EditPoint-Objekts angibt.An integer value indicating the character offset of the EditPoint object.

Implementiert

Attribute

Beispiele

Sub LineCharOffsetExample(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 & _  
        "LineCharOffset: " & point.LineCharOffset & vbCrLf & _  
        "DisplayColumn: " & point.DisplayColumn & vbCrLf & _  
        "AtEndOfDocument: " & point.AtEndOfDocument & vbCrLf & _  
        "AtEndOfLine: " & point.AtEndOfLine & vbCrLf & _  
        "AtStartOfDocument: " & point.AtStartOfDocument & vbCrLf & _  
        "AtStartOfLine: " & point.AtStartOfLine)  

End Sub  
public void LineCharOffsetExample(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 = 0; i < 10; ++i)  
        point.Insert("This is a test.\n");  

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

Hinweise

Die Zeichen Nummerierung beginnt bei 1.Character numbering begins at one. LineCharOffset Gibt die Anzahl der Zeichen zurück, die das Objekt von der linken Seite einer Zeile im Dokument entfernt wird.LineCharOffset returns the number of characters the object is from the left side of a line in the document.

Gilt für: