Metodo EditPoint2.NextBookmark

Consente di passare alla posizione del segnalibro successivo nel documento.

Spazio dei nomi:  EnvDTE80
Assembly:  EnvDTE80 (in EnvDTE80.dll)

Sintassi

'Dichiarazione
Function NextBookmark As Boolean
bool NextBookmark()
bool NextBookmark()
abstract NextBookmark : unit -> bool 
function NextBookmark() : boolean

Valore restituito

Tipo: System.Boolean
true se il punto di inserimento viene spostato sull'inserire un segnalibro, in caso contrario, false.

Note

EditPoint si sposta nella nuova posizione.Se non sono presenti più segnalibri, nessun spostamento si verifica.

Esempi

Sub NextBookmarkExample(ByVal dte As DTE2)

    ' Create a new text document.
    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 ten lines of text.
    For i = 1 To 10
        point.Insert("This is a test." & vbCrLf)
    Next

    point.StartOfDocument()

    ' Set a bookmark on each of the first two lines.
    point.SetBookmark()
    point.LineDown(1)
    point.SetBookmark()

    ' Insert text at each bookmark and then clear each bookmark.
    point.PreviousBookmark()
    point.Insert("BOOKMARK 1: ")
    point.ClearBookmark()
    point.NextBookmark()
    point.Insert("BOOKMARK 2: ")
    point.ClearBookmark()

End Sub
public void NextBookmarkExample(DTE2 dte)
{
    // Create a new text document.
    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 ten lines of text.
    for (int i = 1; i <= 10; ++i)
        point.Insert("This is a test.\n");

    point.StartOfDocument();

    // Set a bookmark on each of the first two lines.
    point.SetBookmark();
    point.LineDown(1);
    point.SetBookmark();

    // Insert text at each bookmark and then clear each bookmark.
    point.PreviousBookmark();
    point.Insert("BOOKMARK 1: ");
    point.ClearBookmark();
    point.NextBookmark();
    point.Insert("BOOKMARK 2: ");
    point.ClearBookmark();
}

Sicurezza di .NET Framework

Vedere anche

Riferimenti

EditPoint2 Interfaccia

Overload NextBookmark

Spazio dei nomi EnvDTE80

Altre risorse

Procedura: compilare ed eseguire gli esempi di codice del modello a oggetti di automazione