NanoByte Code Generation  0.3.1
Wrapper around Roslyn API to simplify generating C# code
NanoByte.CodeGeneration.CSharpIdentifier Class Reference

The fully qualified name of a type. More...

Public Member Functions

 CSharpIdentifier (string? ns, string name, bool nullable=false)
 Creates a new identifier. More...
 
CSharpIdentifier ToNullable ()
 Returns a copy of the identifier with Nullable set to true. More...
 
CSharpIdentifier ToInterface ()
 Returns a copy of the identifier with an I prepended to the Name. More...
 
override string ToString ()
 Returns the name of the type with potential type arguments. More...
 

Static Public Member Functions

static CSharpIdentifier ListOf (CSharpIdentifier type)
 
static CSharpIdentifier DictionaryOf (CSharpIdentifier keyType, CSharpIdentifier valueType)
 

Package Functions

IEnumerable< string > GetNamespaces ()
 Returns a list of all namespaces referenced/used in this identifier. More...
 
TypeSyntax ToSyntax ()
 Returns a Roslyn syntax for the type identifier. More...
 

Properties

string? Namespace [get]
 The namespace containing the type. More...
 
string Name [get]
 The name of the type. More...
 
bool Nullable [get]
 Indicates whether the type can have the value null. More...
 
List< CSharpIdentifierTypeArguments = new List<CSharpIdentifier>() [get]
 Generic type arguments for the type. More...
 
static CSharpIdentifier Bool [get]
 
static CSharpIdentifier Int [get]
 
static CSharpIdentifier Long [get]
 
static CSharpIdentifier Float [get]
 
static CSharpIdentifier Double [get]
 
static CSharpIdentifier String [get]
 
static CSharpIdentifier Object [get]
 
static CSharpIdentifier Uri [get]
 

Detailed Description

The fully qualified name of a type.

Constructor & Destructor Documentation

◆ CSharpIdentifier()

NanoByte.CodeGeneration.CSharpIdentifier.CSharpIdentifier ( string?  ns,
string  name,
bool  nullable = false 
)
inline

Creates a new identifier.

Parameters
nsThe namespace containing the type.
nameThe name of the type.
nullableIndicates whether the type can have the value null.

Member Function Documentation

◆ GetNamespaces()

IEnumerable<string> NanoByte.CodeGeneration.CSharpIdentifier.GetNamespaces ( )
inlinepackage

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

◆ ToInterface()

CSharpIdentifier NanoByte.CodeGeneration.CSharpIdentifier.ToInterface ( )
inline

Returns a copy of the identifier with an I prepended to the Name.

◆ ToNullable()

CSharpIdentifier NanoByte.CodeGeneration.CSharpIdentifier.ToNullable ( )

Returns a copy of the identifier with Nullable set to true.

◆ ToString()

override string NanoByte.CodeGeneration.CSharpIdentifier.ToString ( )

Returns the name of the type with potential type arguments.

◆ ToSyntax()

TypeSyntax NanoByte.CodeGeneration.CSharpIdentifier.ToSyntax ( )
inlinepackage

Returns a Roslyn syntax for the type identifier.

Property Documentation

◆ Name

string NanoByte.CodeGeneration.CSharpIdentifier.Name
get

The name of the type.

◆ Namespace

string? NanoByte.CodeGeneration.CSharpIdentifier.Namespace
get

The namespace containing the type.

◆ Nullable

bool NanoByte.CodeGeneration.CSharpIdentifier.Nullable
get

Indicates whether the type can have the value null.

◆ TypeArguments

List<CSharpIdentifier> NanoByte.CodeGeneration.CSharpIdentifier.TypeArguments = new List<CSharpIdentifier>()
get

Generic type arguments for the type.


The documentation for this class was generated from the following files: