Exemple #1
0
        public static Run ToRun(this SymbolDisplayPart part)
        {
            var text = part.ToVisibleDisplayString(includeLeftToRightMarker: true);

            var run = new Run(text);

            //var format = formatMap.GetTextProperties(typeMap.GetClassificationType(part.Kind.ToClassificationTypeName()));
            //run.SetTextProperties(format);

            return(run);
        }
        public static Run ToRun(this SymbolDisplayPart part)
        {
            var text = part.ToVisibleDisplayString(includeLeftToRightMarker: true);

            var run = new Run(text);

            switch (part.Kind)
            {
            case SymbolDisplayPartKind.Keyword:
                run.Foreground = Brushes.Blue;
                break;

            case SymbolDisplayPartKind.StructName:
            case SymbolDisplayPartKind.EnumName:
            case SymbolDisplayPartKind.TypeParameterName:
            case SymbolDisplayPartKind.ClassName:
            case SymbolDisplayPartKind.DelegateName:
            case SymbolDisplayPartKind.InterfaceName:
                run.Foreground = Brushes.Teal;
                break;
            }

            return(run);
        }