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
writerTextWriter- The TextWriter to which the member definition is written.
memberIMember- The member whose definition is to be written.
linkerMemberDocLinker optional- An optional delegate for linking to the documentation of a type or type's member.
Exceptions
- ArgumentNullException
- Thrown when
writerormemberisnull. - ArgumentException
- Thrown when the
membertype 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
