CSharp.WriteDefinition Method

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

Definition

Writes the definition of a specified member as it appears in C# code to the provided TextWriter.
public virtual void WriteDefinition(TextWriter writer, IMember member, MemberDocLinker linker = null)

Parameters

writer TextWriter
The TextWriter to which the member definition is written.
member IMember
The member whose definition is to be written.
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.
ArgumentException
Thrown when the member type is not supported.

Remarks

The output includes a complete C# code definition of the member, containing:
  • ComponentDescription and Example
  • AttributesAny applied attributes
  • Access ModifiersVisibility and other modifiers
  • Type InformationReturn types, parameter types, and generic constraints where applicable
  • SignatureMember name and parameters
  • Property AccessorsGet and set accessors with their access modifiers
  • ConstraintsGeneric type constraints if present