|
|
@ -109,6 +109,15 @@ namespace ICSharpCode.ILSpy.TextView |
|
|
|
var document = new TextDocument(signature); |
|
|
|
var document = new TextDocument(signature); |
|
|
|
var richText = highlighting ?? DocumentPrinter.ConvertTextDocumentToRichText(document, new DocumentHighlighter(document, highlightingDefinition)).ToRichTextModel(); |
|
|
|
var richText = highlighting ?? DocumentPrinter.ConvertTextDocumentToRichText(document, new DocumentHighlighter(document, highlightingDefinition)).ToRichTextModel(); |
|
|
|
var block = new Paragraph(); |
|
|
|
var block = new Paragraph(); |
|
|
|
|
|
|
|
// HACK: measure width of signature using a TextBlock
|
|
|
|
|
|
|
|
// Paragraph sadly does not support TextWrapping.NoWrap
|
|
|
|
|
|
|
|
var text = new TextBlock { |
|
|
|
|
|
|
|
FontFamily = GetCodeFont(), |
|
|
|
|
|
|
|
TextAlignment = TextAlignment.Left |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
text.Inlines.AddRange(richText.CreateRuns(document)); |
|
|
|
|
|
|
|
text.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity)); |
|
|
|
|
|
|
|
this.document.MinPageWidth = text.DesiredSize.Width; |
|
|
|
block.Inlines.AddRange(richText.CreateRuns(document)); |
|
|
|
block.Inlines.AddRange(richText.CreateRuns(document)); |
|
|
|
block.FontFamily = GetCodeFont(); |
|
|
|
block.FontFamily = GetCodeFont(); |
|
|
|
block.TextAlignment = TextAlignment.Left; |
|
|
|
block.TextAlignment = TextAlignment.Left; |
|
|
@ -262,11 +271,9 @@ namespace ICSharpCode.ILSpy.TextView |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool? ParseBool(string input) |
|
|
|
bool? ParseBool(string input) |
|
|
|
{ |
|
|
|
{ |
|
|
|
bool result; |
|
|
|
if (bool.TryParse(input, out bool result)) |
|
|
|
if (bool.TryParse(input, out result)) |
|
|
|
|
|
|
|
return result; |
|
|
|
return result; |
|
|
|
else |
|
|
|
else |
|
|
|
return null; |
|
|
|
return null; |
|
|
@ -356,8 +363,9 @@ namespace ICSharpCode.ILSpy.TextView |
|
|
|
if (referencedEntity != null) { |
|
|
|
if (referencedEntity != null) { |
|
|
|
if (element.Children.Any()) { |
|
|
|
if (element.Children.Any()) { |
|
|
|
Hyperlink link = new Hyperlink(); |
|
|
|
Hyperlink link = new Hyperlink(); |
|
|
|
// TODO
|
|
|
|
link.Click += (sender, e) => { |
|
|
|
//link.Click += CreateNavigateOnClickHandler(referencedEntity);
|
|
|
|
MainWindow.Instance.JumpToReference(referencedEntity); |
|
|
|
|
|
|
|
}; |
|
|
|
AddSpan(link, element.Children); |
|
|
|
AddSpan(link, element.Children); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
AddInline(ConvertReference(referencedEntity)); |
|
|
|
AddInline(ConvertReference(referencedEntity)); |
|
|
|