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:
  • Component–Description and Example
  • Attributes–Any applied attributes
  • Access Modifiers–Visibility and other modifiers
  • Type Information–Return types, parameter types, and generic constraints where applicable
  • Signature–Member name and parameters
  • Property Accessors–Get and set accessors with their access modifiers
  • Constraints–Generic type constraints if present