Show / Hide Table of Contents

Class CSharpIdentifier

The fully qualified name of a type.

Inheritance
Object
CSharpIdentifier
Namespace: NanoByte.CodeGeneration
Assembly: NanoByte.CodeGeneration.dll
Syntax
public class CSharpIdentifier : Object

Constructors

CSharpIdentifier(String, String, Boolean)

Creates a new identifier.

Declaration
public CSharpIdentifier(string ns, string name, bool nullable = false)
Parameters
Type Name Description
String ns

The namespace containing the type.

String name

The name of the type.

Boolean nullable

Indicates whether the type can have the value null.

Properties

Bool

Declaration
public static CSharpIdentifier Bool { get; }
Property Value
Type Description
CSharpIdentifier

Double

Declaration
public static CSharpIdentifier Double { get; }
Property Value
Type Description
CSharpIdentifier

Float

Declaration
public static CSharpIdentifier Float { get; }
Property Value
Type Description
CSharpIdentifier

Int

Declaration
public static CSharpIdentifier Int { get; }
Property Value
Type Description
CSharpIdentifier

Long

Declaration
public static CSharpIdentifier Long { get; }
Property Value
Type Description
CSharpIdentifier

Name

The name of the type.

Declaration
public string Name { get; }
Property Value
Type Description
String

Namespace

The namespace containing the type.

Declaration
public string Namespace { get; }
Property Value
Type Description
String

Nullable

Indicates whether the type can have the value null.

Declaration
public bool Nullable { get; }
Property Value
Type Description
Boolean

Object

Declaration
public static CSharpIdentifier Object { get; }
Property Value
Type Description
CSharpIdentifier

String

Declaration
public static CSharpIdentifier String { get; }
Property Value
Type Description
CSharpIdentifier

TypeArguments

Generic type arguments for the type.

Declaration
public List<CSharpIdentifier> TypeArguments { get; }
Property Value
Type Description
List<CSharpIdentifier>

Uri

Declaration
public static CSharpIdentifier Uri { get; }
Property Value
Type Description
CSharpIdentifier

Methods

DictionaryOf(CSharpIdentifier, CSharpIdentifier)

Declaration
public static CSharpIdentifier DictionaryOf(CSharpIdentifier keyType, CSharpIdentifier valueType)
Parameters
Type Name Description
CSharpIdentifier keyType
CSharpIdentifier valueType
Returns
Type Description
CSharpIdentifier

ListOf(CSharpIdentifier)

Declaration
public static CSharpIdentifier ListOf(CSharpIdentifier type)
Parameters
Type Name Description
CSharpIdentifier type
Returns
Type Description
CSharpIdentifier

ToInterface()

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

Declaration
public CSharpIdentifier ToInterface()
Returns
Type Description
CSharpIdentifier

ToNullable()

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

Declaration
public CSharpIdentifier ToNullable()
Returns
Type Description
CSharpIdentifier

ToString()

Returns the name of the type with potential type arguments.

Declaration
public override string ToString()
Returns
Type Description
String
In This Article
Back to top Copyright Bastian Eicher