CodeEvent.EndPoint 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取源文件中标记为代码事件元素末尾的位置。
public:
property EnvDTE::TextPoint ^ EndPoint { EnvDTE::TextPoint ^ get(); };
public:
property EnvDTE::TextPoint ^ EndPoint { EnvDTE::TextPoint ^ get(); };
[System.Runtime.InteropServices.DispId(11)]
public EnvDTE.TextPoint EndPoint { [System.Runtime.InteropServices.DispId(11)] [System.Runtime.InteropServices.TypeLibFunc(1024)] get; }
[<System.Runtime.InteropServices.DispId(11)>]
[<get: System.Runtime.InteropServices.DispId(11)>]
[<get: System.Runtime.InteropServices.TypeLibFunc(1024)>]
member this.EndPoint : EnvDTE.TextPoint
Public ReadOnly Property EndPoint As TextPoint
属性值
TextPoint 对象。
- 属性
示例
下面的示例演示如何使用 EndPoint 属性。
public static void EndPoint(EnvDTE80.DTE2 dte)
{
TextSelection objTextSel;
EnvDTE80.CodeEvent codeEvent;
objTextSel = (TextSelection)dte.ActiveDocument.Selection;
codeEvent = (EnvDTE80.CodeEvent)objTextSel.ActivePoint.get_CodeElement(vsCMElement.vsCMElementEvent);
MessageBox.Show("\nEnd point column number: " +
codeEvent.EndPoint.DisplayColumn, "Testing EndPoint Property");
}
注解
编辑点位置紧跟在代码事件元素的最后一个字符之后 (包括任何分号、终止语法或分隔语法) 。 如果源文件可以打开,获取属性将隐式打开它。 但是,某些语言无法打开磁盘上的任意文件,并且只能打开当前打开的解决方案中的文件。
备注
在进行了某些类型的编辑之后,代码模型元素(例如类、结构、函数、特性、委托等)的值可能变为非确定性的,这意味着不能确定它们的值始终保持不变。