CSharp Class
- Namespace
- Kampute.DocToolkit.Languages
- Assembly
Definition
Represents the C# programming language model.
public class CSharp : IProgrammingLanguage
- Inheritance
- Implements
Constructors
Properties
| Identifier | Gets the identifier used for signature highlighting of code written in the programming language. |
| Name | Gets the name of the language. |
| Options | Gets the options the define the behavior of the C# language when formatting code elements. |
Methods
| IsLanguageKeyword(string) | Determines if the specified value is a C# keyword. |
| ToString() | Returns a string that represents the name of the programming language. |
| TryGetKeywordUrl(string, out Uri) | Attempts to get the documentation URL for a given C# keyword. |
| TryGetOperatorSymbol(string, out string) | Attempts to get the operator symbol for a given operator name. |
| TryGetSimplifiedName(IType, out string) | Attempts to retrieve the simplified name of a system type. |
| TryGetUrl(string, out Uri) | Attempts to retrieves the URL to the official documentation for a specified C# keyword. |
| WriteAttribute(TextWriter, ICustomAttribute, NameQualifier, MemberDocLinker) | Writes the specified attribute formatted according to C# syntax rules to the provided TextWriter. |
| WriteConstantValue(TextWriter, object, IType, MemberDocLinker) | Writes a constant value formatted according to C# syntax rules to the provided TextWriter. |
| WriteDefinition(TextWriter, IMember, MemberDocLinker) | Writes the definition of a specified member as it appears in C# code to the provided TextWriter. |
| WriteLiteral(TextWriter, object) | Writes a literal value to the TextWriter. |
| WriteName(TextWriter, IMember, NameQualifier, MemberDocLinker) | Writes the name of a member formatted according to C# syntax rules to the provided TextWriter. |
| WriteSignature(TextWriter, IMember, NameQualifier, MemberDocLinker) | Writes the signature of a member formatted according to C# syntax rules to the provided TextWriter. |
Extension Methods
| FormatAttribute(this IProgrammingLanguage, ICustomAttribute, NameQualifier) | Formats the specified custom attribute according to syntax rules of the language. |
| FormatCodeReference(this IProgrammingLanguage, string, Func<IMember, NameQualifier>) | Formats the given code reference (cref) according to syntax rules of the language. |
| FormatDefinition(this IProgrammingLanguage, IMember) | Formats the definition of the specified member according to syntax rules of the language. |
| FormatLiteral(this IProgrammingLanguage, object) | Formats the given literal value according to syntax rules of the language. |
| FormatName(this IProgrammingLanguage, IMember, NameQualifier) | Formats the name of the specified member according to syntax rules of the language. |
| FormatSignature(this IProgrammingLanguage, IMember, NameQualifier) | Formats the signature of the specified member according to syntax rules of the language. |
- Rendering type and member signatures according to C# syntax conventions
- Formatting type definitions with proper modifiers and constraints
- Handling special C# features like operators, extension methods, and attributes
- Properly formatting literals according to C# syntax rules
- Providing links to official C# documentation for language keywords
This class serves as the foundation for generating properly formatted C# references in documentation, ensuring that code snippets and API references follow standard C# conventions.The CSharp class supports customization through CodeStyleOptions to adjust the formatting style to match different coding standards and preferences.