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
writerTextWriter- The TextWriter to which the member's signature is written.
memberIMember- The member whose signature is to be written.
qualifierNameQualifier- The level of qualification to apply to the member's name.
linkerMemberDocLinker optional- An optional delegate for linking to the documentation of a type or type's member.
Exceptions
- ArgumentNullException
- Thrown when
writerormemberisnull.
Remarks
The signature format varies by member type as detailed below:
If the member type is not recognized, the member's name is written as is.
| Member Type | Formatted Signature and Example |
|---|---|
| IType | Type name, including its generic parameters and modifiers (e.g., "Dictionary<TKey, TValue>, "string[]", "int*") |
| IField | Field name (e.g., "MinValue") |
| IConstructor | Declaring type name with parameters (e.g., "MyClass(string, int)") |
| IMethod | Method name with its generic and regular parameters (e.g., "Convert<T>(string)") |
| IProperty | Property name with any index parameters (e.g., "Count", "Items[int]") |
| IEvent | Event name (e.g., "PropertyChanged") |
