本文整理匯總了C#中Mono.TextEditor.LineSegment.RemoveMarker方法的典型用法代碼示例。如果您正苦於以下問題:C# LineSegment.RemoveMarker方法的具體用法?C# LineSegment.RemoveMarker怎麽用?C# LineSegment.RemoveMarker使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Mono.TextEditor.LineSegment
的用法示例。
在下文中一共展示了LineSegment.RemoveMarker方法的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: RemoveMarker
public void RemoveMarker (LineSegment line, Type type, bool updateLine)
{
if (line == null || type == null)
return;
if (typeof(IExtendingTextMarker).IsAssignableFrom (type)) {
lock (extendingTextMarkers) {
HeightChanged = true;
foreach (TextMarker marker in line.Markers.Where (marker => marker is IExtendingTextMarker)) {
extendingTextMarkers.Remove (marker);
}
}
}
line.RemoveMarker (type);
if (updateLine)
this.CommitLineUpdate (line);
}