EditPoint2.Line 属性

获取 EditPoint 对象的行号。

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

语法

声明
ReadOnly Property Line As Integer
int Line { get; }
property int Line {
    int get ();
}
abstract Line : int
function get Line () : int

属性值

类型:System.Int32
EditPoint 对象的行号。

备注

行编号从 1 开始。

示例

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);
   }
}

.NET Framework 安全性

请参见

参考

EditPoint2 接口

Line 重载

EnvDTE80 命名空间

其他资源

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