允许 ITextView 访问视图的 ITextViewLine 对象集合。 可以使用 TextViewLines 属性获取 ITextViewLineCollection 接口的实例。
命名空间: Microsoft.VisualStudio.Text.Editor
程序集: Microsoft.VisualStudio.Text.UI.Wpf(在 Microsoft.VisualStudio.Text.UI.Wpf.dll 中)
语法
声明
Public Interface IWpfTextViewLineCollection _
Inherits ITextViewLineCollection, IList(Of ITextViewLine), ICollection(Of ITextViewLine), _
IEnumerable(Of ITextViewLine), IEnumerable
public interface IWpfTextViewLineCollection : ITextViewLineCollection,
IList<ITextViewLine>, ICollection<ITextViewLine>, IEnumerable<ITextViewLine>,
IEnumerable
public interface class IWpfTextViewLineCollection : ITextViewLineCollection,
IList<ITextViewLine^>, ICollection<ITextViewLine^>, IEnumerable<ITextViewLine^>,
IEnumerable
type IWpfTextViewLineCollection =
interface
interface ITextViewLineCollection
interface IList<ITextViewLine>
interface ICollection<ITextViewLine>
interface IEnumerable<ITextViewLine>
interface IEnumerable
end
public interface IWpfTextViewLineCollection extends ITextViewLineCollection, IList<ITextViewLine>, ICollection<ITextViewLine>, IEnumerable<ITextViewLine>, IEnumerable
IWpfTextViewLineCollection 类型公开以下成员。
属性
名称 | 说明 | |
---|---|---|
![]() |
Count | 获取 ICollection 中包含的元素数。 (继承自 ICollection<ITextViewLine>。) |
![]() |
FirstVisibleLine | 获取未完全隐藏的第一行。 |
![]() |
FormattedSpan | 获取包含在此 ITextViewLine 集合中的文本跨距。 (继承自 ITextViewLineCollection。) |
![]() |
IsReadOnly | 获取一个值,该值指示 ICollection 是否为只读。 (继承自 ICollection<ITextViewLine>。) |
![]() |
IsValid | 确定此 ITextViewLineCollection 对象是否仍有效。 (继承自 ITextViewLineCollection。) |
![]() |
Item | 获取在 index的 IWpfTextViewLine 。 |
![]() |
LastVisibleLine | 获取未完全隐藏的最后一行。 |
![]() |
WpfTextViewLines | 获取 IWpfTextViewLine 对象的集合。 |
页首
方法
页首
备注
ITextView 配置它包含其 ITextViewLineCollection 和所有 ITextViewLine 对象,它将生成新的布局时间。
为 double 的大多数属性和参数对应于坐标或在距离 (以文本呈现坐标系表示)。 此坐标系统中, x = 0.0 对应于绘制的左边缘图面在哪个文本上呈现 (x = view.ViewportLeft 对应于视区左边缘),因此, y = view.ViewportTop 对应于视区上边缘。 该 x 坐标从上往下从左至右递增和 y 坐标增加。 视图的水平和垂直轴有不同的行为。 当在视图中设置文本格式,因此,只有可见行设置。 因此,视区不能水平和垂直类似地移动。视区通过将视区左边坐标水平移动,使其移动有关离绘图图面。 视图可以通过执行新的布局仅移动垂直。 执行在视图的格式可能导致 view.ViewportTop 属性更改。 例如,下移一行不会将任何可见的行。
而是将更改 ViewportTop 属性 (导致行移动到屏幕,即使它们的 y 坐标未更改)。在以文本呈现坐标系表示) 的距离对应于逻辑像素为单位。 如果文本呈现图面显示,而无需任何缩放转换,则以文本呈现坐标系表示) 的 1 个单位对应于在显示的一个像素。