static void AddParameterModifier(SymbolFormatter formatter, InlineCollection inlines, IParameterSymbol p) { switch (p.RefKind) { case RefKind.Ref: inlines.Add(new Run("ref ") { Foreground = formatter.Keyword }); return; case RefKind.Out: inlines.Add(new Run("out ") { Foreground = formatter.Keyword }); return; case RefKind.In: inlines.Add(new Run("in ") { Foreground = formatter.Keyword }); return; } if (p.IsParams) { inlines.Add(new Run("params ") { Foreground = formatter.Keyword }); } }
public static TextBlock AddSymbol(this TextBlock block, ISymbol symbol, SymbolFormatter formatter) { if (symbol != null) { formatter.ToUIText(block.Inlines, symbol, null); } return(block); }
public static TextBlock AddSymbolDisplayParts(this TextBlock block, ImmutableArray <SymbolDisplayPart> parts, SymbolFormatter formatter, int argIndex) { return(formatter.ToUIText(block, parts, argIndex)); }
public static TextBlock AddSymbolDisplayParts(this TextBlock block, ImmutableArray <SymbolDisplayPart> parts, SymbolFormatter formatter) { return(formatter.ToUIText(block, parts, Int32.MinValue)); }
public static Paragraph AddSymbol(this Paragraph paragraph, ISymbol symbol, string alias, SymbolFormatter formatter) { if (symbol != null) { formatter.ToUIText(paragraph.Inlines, symbol, alias); } return(paragraph); }
public static TextBlock AddParameters(this TextBlock block, ImmutableArray <IParameterSymbol> parameters, SymbolFormatter formatter, int argIndex) { var inlines = block.Inlines; inlines.Add("("); for (var i = 0; i < parameters.Length; i++) { if (i > 0) { inlines.Add(", "); } var p = parameters[i]; if (p.IsOptional) { inlines.Add("["); } AddParameterModifier(formatter, inlines, p); formatter.Format(inlines, p.Type, null, false); inlines.Add(" "); inlines.Add(p.Render(null, i == argIndex, formatter.Parameter)); if (p.IsOptional) { inlines.Add("]"); } } inlines.Add(")"); return(block); }
public static TextBlock AddSymbol(this TextBlock block, ISymbol symbol, string alias, SymbolFormatter formatter) { if (symbol != null) { formatter.Format(block.Inlines, symbol, alias, false); } return(block); }
public XmlDocRenderer(Compilation compilation, SymbolFormatter symbolFormatter) { _Compilation = compilation; _SymbolFormatter = symbolFormatter; }
public static TextBlock AddParameters(this TextBlock block, ImmutableArray <IParameterSymbol> parameters, SymbolFormatter formatter, int argIndex) { var inlines = block.Inlines; inlines.Add("("); for (var i = 0; i < parameters.Length; i++) { if (i > 0) { inlines.Add(", "); } formatter.ToUIText(inlines, parameters[i].Type, null); inlines.Add(new Run(" " + parameters[i].Name) { Foreground = formatter.Parameter, FontWeight = i == argIndex ? FontWeights.Bold : FontWeights.Normal }); } inlines.Add(")"); return(block); }
public static TextBlock AddParameters(this TextBlock block, ImmutableArray <IParameterSymbol> parameters, SymbolFormatter formatter) { var inlines = block.Inlines; inlines.Add("("); for (var i = 0; i < parameters.Length; i++) { if (i > 0) { inlines.Add(", "); } formatter.ToUIText(inlines, parameters[i].Type, null); } inlines.Add(")"); return(block); }