Lire en anglais

Partager via


SymbolDisplay Class

Definition

Displays a symbol in the C# style.

C#
public static class SymbolDisplay
Inheritance
SymbolDisplay

Methods

FormatLiteral(Char, Boolean)

Returns a C# character literal with the given value.

FormatLiteral(String, Boolean)

Returns a C# string literal with the given value.

FormatPrimitive(Object, Boolean, Boolean)

Returns a string representation of an object of primitive type.

ToDisplayParts(ISymbol, SymbolDisplayFormat)

Convert a symbol to an array of string parts, each of which has a kind. Useful for colorizing the display string.

ToDisplayParts(ITypeSymbol, NullableAnnotation, SymbolDisplayFormat)
ToDisplayParts(ITypeSymbol, NullableFlowState, SymbolDisplayFormat)
ToDisplayString(ISymbol, SymbolDisplayFormat)

Displays a symbol in the C# style, based on a SymbolDisplayFormat.

ToDisplayString(ITypeSymbol, NullableAnnotation, SymbolDisplayFormat)
ToDisplayString(ITypeSymbol, NullableFlowState, SymbolDisplayFormat)
ToMinimalDisplayParts(ISymbol, SemanticModel, Int32, SymbolDisplayFormat)

Convert a symbol to an array of string parts, each of which has a kind. Useful for colorizing the display string.

ToMinimalDisplayParts(ITypeSymbol, NullableAnnotation, SemanticModel, Int32, SymbolDisplayFormat)
ToMinimalDisplayParts(ITypeSymbol, NullableFlowState, SemanticModel, Int32, SymbolDisplayFormat)
ToMinimalDisplayString(ISymbol, SemanticModel, Int32, SymbolDisplayFormat)

Displays a symbol in the C# style, based on a SymbolDisplayFormat. Based on the context, qualify type and member names as little as possible without introducing ambiguities.

ToMinimalDisplayString(ITypeSymbol, NullableAnnotation, SemanticModel, Int32, SymbolDisplayFormat)
ToMinimalDisplayString(ITypeSymbol, NullableFlowState, SemanticModel, Int32, SymbolDisplayFormat)

Applies to

Produit Versions
Roslyn 4.2.0, 4.3.0, 4.4.0, 4.5.0, 4.6.0, 4.7.0, 4.8.0, 4.9.2, 3.0.0, 3.1.0, 3.2.0, 3.2.1, 3.3.1, 3.4.0, 3.5.0, 3.6.0, 3.7.0, 3.8.0, 3.9.0, 3.10.0, 3.11.0, 4.0.1, 4.1.0, 4.12.2, 4.13.0

See also