コード例 #1
0
		/// <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);
		}
コード例 #2
0
ファイル: RichTextWriter.cs プロジェクト: Paccc/SharpDevelop
		/// <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();
			}
		}
コード例 #3
0
		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;
		}
コード例 #4
0
		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;
		}
コード例 #5
0
		void IOutputCategory.AppendLine(RichText text)
		{
			AppendLine(text.ToString());
		}
コード例 #6
0
ファイル: RichTextWriter.cs プロジェクト: Paccc/SharpDevelop
		/// <summary>
		/// Writes the RichText instance.
		/// </summary>
		public void Write(RichText richText)
		{
			Write(richText, 0, richText.Length);
		}
コード例 #7
0
ファイル: BuildEngine.cs プロジェクト: Paccc/SharpDevelop
		void ReportMessageInternal(RichText message)
		{
			if (combinedBuildFeedbackSink != null)
				combinedBuildFeedbackSink.ReportMessage(message);
		}
コード例 #8
0
ファイル: BuildEngine.cs プロジェクト: Paccc/SharpDevelop
		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);
			}
		}
コード例 #9
0
ファイル: BuildEngine.cs プロジェクト: Paccc/SharpDevelop
			public void ReportMessage(RichText message)
			{
				engine.ReportMessage(this, message);
			}
コード例 #10
0
 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;
 }
コード例 #11
0
 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;
 }
コード例 #12
0
 public void ReportMessage(RichText message)
 {
     messageView.AppendLine(message);
 }