本文整理汇总了C#中ICSharpCode.TextEditor.Document.LineSegment.AddAnchor方法的典型用法代码示例。如果您正苦于以下问题:C# LineSegment.AddAnchor方法的具体用法?C# LineSegment.AddAnchor怎么用?C# LineSegment.AddAnchor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ICSharpCode.TextEditor.Document.LineSegment
的用法示例。
在下文中一共展示了LineSegment.AddAnchor方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SplitTo
/// <summary>
/// Is called after a newline was inserted into this line, splitting it into this and followingLine.
/// </summary>
internal void SplitTo(LineSegment followingLine)
{
//Console.WriteLine("SplitTo");
if (anchors != null) {
List<TextAnchor> movedAnchors = null;
foreach (TextAnchor a in anchors) {
if (a.ColumnNumber > this.Length) {
a.Line = followingLine;
followingLine.AddAnchor(a);
a.ColumnNumber -= this.Length;
if (movedAnchors == null)
movedAnchors = new List<TextAnchor>();
movedAnchors.Add(a);
}
}
if (movedAnchors != null) {
foreach (TextAnchor a in movedAnchors) {
anchors.Remove(a);
}
}
}
}