PublicApiFormatter Class

Formats the symbols of a PublicApiAssembly as C# code.

public static class PublicApiFormatter

Methods

NameDescription
Format(PublicApiAttribute, PublicApiFormattingOptions?)Formats an attribute (e.g. [System.Obsolete("Use another method")]), whether or not the attribute filter selects it.
Format(PublicApiSymbol, PublicApiFormattingOptions?)Formats a type or a member.
Format(PublicApiTypeReference, PublicApiFormattingOptions?)Formats a type reference (e.g. System.Collections.Generic.List<string?>).

Format overloads

Format(PublicApiAttribute, PublicApiFormattingOptions?)

PublicApiFormatter.cs

Formats an attribute (e.g. [System.Obsolete("Use another method")]), whether or not the attribute filter selects it.

public static PublicApiFormattedDeclaration Format(PublicApiAttribute attribute, PublicApiFormattingOptions? options = null)

Format(PublicApiSymbol, PublicApiFormattingOptions?)

PublicApiFormatter.cs

Formats a type or a member.

public static PublicApiFormattedDeclaration Format(PublicApiSymbol symbol, PublicApiFormattingOptions? options = null)
Parameters
symbol PublicApiSymbol
options PublicApiFormattingOptions?
Returns

PublicApiFormattedDeclaration

Remarks

An accessor is formatted as its property, restricted to this accessor in the PublicApiDeclarationStyle.Declaration style, or as its event.

Format(PublicApiTypeReference, PublicApiFormattingOptions?)

PublicApiFormatter.cs

Formats a type reference (e.g. System.Collections.Generic.List<string?>).