Export (0) Print
Expand All

EditPoint.Line Property

Gets the EditPoint object's line number.

Namespace:  EnvDTE
Assembly:  EnvDTE (in EnvDTE.dll)

int Line { get; }

Property Value

Type: System.Int32
The line number of the EditPoint object.

Line numbers start at one.

public void Example(DTE2 dte)
{
   try
   {
      // Open a text document before running this example.
      TextDocument objTD, objTD2;
      EditPoint objEP;

      objTD = (TextDocument)dte.ActiveDocument.Object("TextDocument");
      objEP = (EditPoint)objTD.StartPoint.CreateEditPoint();
      objEP.Insert("Hello ");
      //Show line number at editpoint.
      MessageBox.Show("EditPoint is at line #: " + objEP.Line);
      objTD2 = objEP.Parent;
      MessageBox.Show(objTD2.Type);
   }
   catch (Exception ex)
   {
      MessageBox.Show(ex.Message);
   }
}

Show:
© 2014 Microsoft