示例#1
0
        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);
        }
示例#2
0
 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);
 }
示例#3
0
 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);
 }
示例#4
0
        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);
        }
示例#5
0
        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);
        }
示例#6
0
 public static TextBlock AddSymbolDisplayParts(this TextBlock block, ImmutableArray <SymbolDisplayPart> parts, SymbolFormatter formatter, int argIndex)
 {
     return(formatter.Format(block, parts, argIndex));
 }
示例#7
0
 public static TextBlock AddSymbolDisplayParts(this TextBlock block, ImmutableArray <SymbolDisplayPart> parts, SymbolFormatter formatter)
 {
     return(formatter.Format(block, parts, Int32.MinValue));
 }