CSharp.WriteSignature Method

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

Definition

Writes the signature of a member formatted according to C# syntax rules to the provided TextWriter.
public virtual void WriteSignature(
	TextWriter writer,
	IMember member,
	NameQualifier qualifier,
	MemberDocLinker linker = null)

Parameters

writer TextWriter
The TextWriter to which the member's signature is written.
member IMember
The member whose signature is to be written.
qualifier NameQualifier
The level of qualification to apply to the member's name.
linker MemberDocLinker optional
An optional delegate for linking to the documentation of a type or type's member.

Exceptions

ArgumentNullException
Thrown when writer or member is null.

Remarks

The signature format varies by member type as detailed below:
Member TypeFormatted Signature and Example
ITypeType name, including its generic parameters and modifiers (e.g., "Dictionary<TKey, TValue>, "string[]", "int*")
IFieldField name (e.g., "MinValue")
IConstructorDeclaring type name with parameters (e.g., "MyClass(string, int)")
IMethodMethod name with its generic and regular parameters (e.g., "Convert<T>(string)")
IPropertyProperty name with any index parameters (e.g., "Count", "Items[int]")
IEventEvent name (e.g., "PropertyChanged")
If the member type is not recognized, the member's name is written as is.