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 static TextBlock AddSymbol(this TextBlock block, ISymbol symbol, bool bold, SymbolFormatter formatter) { if (symbol != null) { formatter.Format(block.Inlines, symbol, null, bold); } 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.Format(inlines, parameters[i].Type, null, false); } inlines.Add(")"); return(block); }
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.Format(inlines, parameters[i].Type, null, false); inlines.Add(new Run(" " + parameters[i].Name) { Foreground = formatter.Parameter, FontWeight = i == argIndex ? FontWeights.Bold : FontWeights.Normal }); } inlines.Add(")"); return(block); }
public static TextBlock AddSymbolDisplayParts(this TextBlock block, ImmutableArray <SymbolDisplayPart> parts, SymbolFormatter formatter, int argIndex) { return(formatter.Format(block, parts, argIndex)); }
public static TextBlock AddSymbolDisplayParts(this TextBlock block, ImmutableArray <SymbolDisplayPart> parts, SymbolFormatter formatter) { return(formatter.Format(block, parts, Int32.MinValue)); }