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);
        }