/// <summary> /// Creates a new HighlightedInlineBuilder instance. /// </summary> public HighlightedInlineBuilder(RichText text) { if (text == null) throw new ArgumentNullException("text"); this.text = text.Text; stateChangeOffsets.AddRange(text.stateChangeOffsets); stateChanges.AddRange(text.stateChanges); }
/// <summary> /// Writes the RichText instance. /// </summary> public virtual void Write(RichText richText, int offset, int length) { foreach (var section in richText.GetHighlightedSections(offset, length)) { BeginSpan(section.Color); Write(richText.Text.Substring(section.Offset, section.Length)); EndSpan(); } }
public SearchResultMatch(FileName fileName, TextLocation startLocation, TextLocation endLocation, int offset, int length, RichText displayText, HighlightingColor defaultTextColor) { if (fileName == null) throw new ArgumentNullException("fileName"); this.fileName = fileName; this.startLocation = startLocation; this.endLocation = endLocation; this.offset = offset; this.length = length; this.displayText = displayText; this.defaultTextColor = defaultTextColor; }
protected override object CreateText() { var location = anchor.Location; LoggingService.Debug("Creating text for search result (" + location.Line + ", " + location.Column + ") "); TextBlock textBlock = new TextBlock(); textBlock.FontFamily = new FontFamily(SD.EditorControlService.GlobalOptions.FontFamily); if (result.DefaultTextColor != null && !IsSelected) { if (result.DefaultTextColor.Background != null) textBlock.Background = result.DefaultTextColor.Background.GetBrush(null); if (result.DefaultTextColor.Foreground != null) textBlock.Foreground = result.DefaultTextColor.Foreground.GetBrush(null); } textBlock.Inlines.Add("(" + location.Line + ", " + location.Column + ")\t"); RichText displayText = result.DisplayText; if (displayText != null) { if (IsSelected) { RichTextModel model = displayText.ToRichTextModel(); model.SetForeground(0, displayText.Length, null); model.SetBackground(0, displayText.Length, null); displayText = new RichText(displayText.Text, model); } textBlock.Inlines.AddRange(displayText.CreateRuns()); } if (showFileName) { textBlock.Inlines.Add( new Run { Text = StringParser.Parse("\t${res:MainWindow.Windows.SearchResultPanel.In} ") + Path.GetFileName(anchor.FileName) + "(" + Path.GetDirectoryName(anchor.FileName) +")", FontStyle = FontStyles.Italic }); } return textBlock; }
void IOutputCategory.AppendLine(RichText text) { AppendLine(text.ToString()); }
/// <summary> /// Writes the RichText instance. /// </summary> public void Write(RichText richText) { Write(richText, 0, richText.Length); }
void ReportMessageInternal(RichText message) { if (combinedBuildFeedbackSink != null) combinedBuildFeedbackSink.ReportMessage(message); }
void ReportMessage(BuildNode source, RichText message) { bool hasOutputLock; lock (this) { if (nodeWithOutputLock == null) { nodeWithOutputLock = source; } hasOutputLock = nodeWithOutputLock == source; if (!hasOutputLock) { if (source.unreportedMessageList == null) { nodesWaitingForOutputLock.Enqueue(source); source.unreportedMessageList = new List<RichText>(); } source.unreportedMessageList.Add(message); } } if (hasOutputLock) { ReportMessageInternal(message); } }
public void ReportMessage(RichText message) { engine.ReportMessage(this, message); }
public AvalonEditSearchResultMatch(FileName fileName, TextLocation startLocation, TextLocation endLocation, int offset, int length, RichText richText, HighlightingColor defaultTextColor, ICSharpCode.AvalonEdit.Search.ISearchResult match) : base(fileName, startLocation, endLocation, offset, length, richText, defaultTextColor) { this.match = match; }
public RenameResultMatch(FileName fileName, TextLocation startLocation, TextLocation endLocation, int offset, int length, string newCode, RichText richText = null, HighlightingColor defaultTextColor = null) : base(fileName, startLocation, endLocation, offset, length, richText, defaultTextColor) { this.NewCode = newCode; }
public void ReportMessage(RichText message) { messageView.AppendLine(message); }