本文整理匯總了C#中Mono.TextEditor.LineSegment.AddMarker方法的典型用法代碼示例。如果您正苦於以下問題:C# LineSegment.AddMarker方法的具體用法?C# LineSegment.AddMarker怎麽用?C# LineSegment.AddMarker使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Mono.TextEditor.LineSegment
的用法示例。
在下文中一共展示了LineSegment.AddMarker方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Analyze
public override void Analyze (Document doc, LineSegment line, Chunk startChunk, int startOffset, int endOffset)
{
if (endOffset <= startOffset || startOffset >= doc.Length)
return;
string text = doc.GetTextAt (startOffset, endOffset - startOffset);
int startColumn = startOffset - line.Offset;
line.RemoveMarker (typeof(UrlMarker));
foreach (System.Text.RegularExpressions.Match m in urlRegex.Matches (text)) {
line.AddMarker (new UrlMarker (line, m.Value, UrlType.Url, syntax, startColumn + m.Index, startColumn + m.Index + m.Length));
}
foreach (System.Text.RegularExpressions.Match m in mailRegex.Matches (text)) {
line.AddMarker (new UrlMarker (line, m.Value, UrlType.Email, syntax, startColumn + m.Index, startColumn + m.Index + m.Length));
}
}
示例2: AddMarker
public void AddMarker (LineSegment line, TextMarker marker, bool commitUpdate)
{
if (line == null || marker == null)
return;
if (marker is IExtendingTextMarker) {
lock (extendingTextMarkers) {
HeightChanged = true;
extendingTextMarkers.Add (marker);
extendingTextMarkers.Sort (CompareMarkers);
}
}
line.AddMarker (marker);
OnMarkerAdded (new TextMarkerEvent (line, marker));
if (commitUpdate)
this.CommitLineUpdate (line);
}