LanguageExtensions.FormatCodeReference Method

Namespace
Kampute.DocToolkit.Languages
Assembly
  • Kampute.DocToolkit.dll

Definition

Formats the given code reference (cref) according to syntax rules of the language.
public static string FormatCodeReference(this IProgrammingLanguage language, string cref, Func<IMember, NameQualifier> qualifierSelector = null)

Parameters

language IProgrammingLanguage
The IProgrammingLanguage instance.
cref string
The code reference string to format.
qualifierSelector Func<IMember, NameQualifier> optional
An optional function to determine the level of qualification for the member's name; if not provided, defaults to NameQualifier.DeclaringType.

Returns

string
A formatted representation of the code reference according to syntax rules of the language if it can be resolved; otherwise, the original cref string.

Exceptions

ArgumentNullException
Thrown when language or cref is null.