EditPoint.AtStartOfDocument, propriété

Obtient une valeur qui indique si l'objet se trouve au début du document.

Espace de noms :  EnvDTE
Assembly :  EnvDTE (dans EnvDTE.dll)

Syntaxe

'Déclaration
ReadOnly Property AtStartOfDocument As Boolean
    Get
bool AtStartOfDocument { get; }
property bool AtStartOfDocument {
    bool get ();
}
abstract AtStartOfDocument : bool
function get AtStartOfDocument () : boolean

Valeur de propriété

Type : System.Boolean
true si vous vous trouvez au début du document ; false dans le cas contraire.

Implémentations

TextPoint.AtStartOfDocument

Notes

La numérotation des caractères débute à 1.

Exemples

Sub AtStartOfDocumentExample(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 AtStartOfDocumentExample(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);
}

Sécurité .NET Framework

Voir aussi

Référence

EditPoint Interface

AtStartOfDocument, surcharge

EnvDTE, espace de noms

Autres ressources

Comment : compiler et exécuter les exemples de code du modèle objet Automation