Esempio n. 1
0
        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
                });
            }
        }
Esempio n. 2
0
 public static TextBlock AddSymbol(this TextBlock block, ISymbol symbol, SymbolFormatter formatter)
 {
     if (symbol != null)
     {
         formatter.ToUIText(block.Inlines, symbol, null);
     }
     return(block);
 }
Esempio n. 3
0
 public static TextBlock AddSymbolDisplayParts(this TextBlock block, ImmutableArray <SymbolDisplayPart> parts, SymbolFormatter formatter, int argIndex)
 {
     return(formatter.ToUIText(block, parts, argIndex));
 }
Esempio n. 4
0
 public static TextBlock AddSymbolDisplayParts(this TextBlock block, ImmutableArray <SymbolDisplayPart> parts, SymbolFormatter formatter)
 {
     return(formatter.ToUIText(block, parts, Int32.MinValue));
 }
Esempio n. 5
0
 public static Paragraph AddSymbol(this Paragraph paragraph, ISymbol symbol, string alias, SymbolFormatter formatter)
 {
     if (symbol != null)
     {
         formatter.ToUIText(paragraph.Inlines, symbol, alias);
     }
     return(paragraph);
 }
Esempio n. 6
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);
        }
Esempio n. 7
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);
 }
Esempio n. 8
0
 public XmlDocRenderer(Compilation compilation, SymbolFormatter symbolFormatter)
 {
     _Compilation     = compilation;
     _SymbolFormatter = symbolFormatter;
 }
Esempio n. 9
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.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);
        }
Esempio n. 10
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.ToUIText(inlines, parameters[i].Type, null);
            }
            inlines.Add(")");
            return(block);
        }