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

A property on a CSharpInterface or CSharpClass. More...

Public Member Functions

 CSharpProperty (CSharpIdentifier type, string name)
 Creates a new property. More...
 
override string ToString ()
 Returns the name of the property. More...
 

Package Functions

IEnumerable< string > GetNamespaces ()
 Returns a list of all namespaces referenced/used in this property. More...
 
PropertyDeclarationSyntax ToSyntax (bool makePublic=false)
 Returns a Roslyn syntax for the property. More...
 

Properties

CSharpIdentifier Type [get]
 The type of the property. More...
 
string Name [get]
 The name of the property. More...
 
string? Summary [get, set]
 A summary used for an XML documentation comment. More...
 
List< CSharpAttributeAttributes = new List<CSharpAttribute>() [get]
 Attributes to apply to the property. More...
 
CSharpConstructorInitializer [get, set]
 The property's initializer (sets default value). More...
 
CSharpConstructorGetterExpression [get, set]
 An expression body for the property's getter. More...
 
bool HasSetter [get, set]
 Indicates whether the property has a setter. More...
 

Detailed Description

A property on a CSharpInterface or CSharpClass.

Constructor & Destructor Documentation

◆ CSharpProperty()

NanoByte.CodeGeneration.CSharpProperty.CSharpProperty ( CSharpIdentifier  type,
string  name 
)
inline

Creates a new property.

Parameters
typeThe type of the property.
nameThe name of the property.

Member Function Documentation

◆ GetNamespaces()

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

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

◆ ToString()

override string NanoByte.CodeGeneration.CSharpProperty.ToString ( )

Returns the name of the property.

◆ ToSyntax()

PropertyDeclarationSyntax NanoByte.CodeGeneration.CSharpProperty.ToSyntax ( bool  makePublic = false)
inlinepackage

Returns a Roslyn syntax for the property.

Parameters
makePublicControls whether to make the property public or not.

Property Documentation

◆ Attributes

List<CSharpAttribute> NanoByte.CodeGeneration.CSharpProperty.Attributes = new List<CSharpAttribute>()
get

Attributes to apply to the property.

◆ GetterExpression

CSharpConstructor? NanoByte.CodeGeneration.CSharpProperty.GetterExpression
getset

An expression body for the property's getter.

◆ HasSetter

bool NanoByte.CodeGeneration.CSharpProperty.HasSetter
getset

Indicates whether the property has a setter.

◆ Initializer

CSharpConstructor? NanoByte.CodeGeneration.CSharpProperty.Initializer
getset

The property's initializer (sets default value).

◆ Name

string NanoByte.CodeGeneration.CSharpProperty.Name
get

The name of the property.

◆ Summary

string? NanoByte.CodeGeneration.CSharpProperty.Summary
getset

A summary used for an XML documentation comment.

◆ Type

CSharpIdentifier NanoByte.CodeGeneration.CSharpProperty.Type
get

The type of the property.


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