Table of Contents

Class CSharpType

Namespace
NanoByte.CodeGeneration
Assembly
NanoByte.CodeGeneration.dll

Describes a C# type for which code can be generated.

public abstract class CSharpType : ICSharpType
Inheritance
CSharpType
Implements
Derived
Inherited Members
Extension Methods

Constructors

CSharpType(CSharpIdentifier)

Creates a new C# type.

protected CSharpType(CSharpIdentifier identifier)

Parameters

identifier CSharpIdentifier

The fully qualified name of the type.

Properties

Attributes

Attributes to apply to the type.

public List<CSharpAttribute> Attributes { get; }

Property Value

List<CSharpAttribute>

Identifier

The fully qualified name of the type.

public CSharpIdentifier Identifier { get; }

Property Value

CSharpIdentifier

Summary

A summary used for an XML documentation comment.

public string? Summary { get; set; }

Property Value

string

Methods

GetMemberDeclaration()

Returns a Roslyn syntax for the type.

protected abstract MemberDeclarationSyntax GetMemberDeclaration()

Returns

MemberDeclarationSyntax

GetNamespaces()

Returns a list of all namespaces referenced/used in this type.

protected virtual ISet<string> GetNamespaces()

Returns

ISet<string>

ToString()

Returns the name of the type.

public override string ToString()

Returns

string

ToSyntax()

Returns a Roslyn syntax for a file containing the type.

public CompilationUnitSyntax ToSyntax()

Returns

CompilationUnitSyntax