C# Class BACnet.SchemaCompiler.CodeGen.CSharpTypeGenerator.CSharpEmitter

Inheritance: IDisposable
Datei anzeigen Open project: LorenVS/bacstack

Public Methods

Method Description
AbstractProperty ( string name, string type, Access access = Access.Public ) : void

Creates a new abstract property

Break ( ) : void

Generates a break

CSharpEmitter ( string path ) : System

Constructs a new csharp emitter

Case ( string expression ) : void

Generates a case

Class ( string name, bool isAbstract = false, string bases = null, Access access = Access.Public ) : CSharpEmitter

Enters a class

Constructor ( string name, Parameter parameters, Access access = Access.Public, bool deferDefault = false ) : CSharpEmitter

Enters a new constructor

Default ( ) : void

Enters a default case

Dispose ( ) : void

Disposes of the emitter

EmitUsing ( string ns ) : void

Emits a using clause

Enum ( string name, string baseType = "uint" ) : CSharpEmitter

Enters an enum

EnumValue ( string name, int value, bool last = false ) : void

Generates an enumeration value

IndentString ( int modifier ) : string

Retrieves the current indentation string

Namespace ( string ns ) : CSharpEmitter

Enters a namespace

OverrideProperty ( string name, string type, string body, Access access = Access.Public ) : void

Overrides a get-only property

Property ( string name, string type, Access access = Access.Public, Access setter = Access.Private ) : void

Creates a new property

Property ( string name, string type, string body, Access access = Access.Public ) : void

Creates a new get-only property

StaticMethod ( string name, string returnType, Parameter parameters, Access access = Access.Public, bool @new = false ) : CSharpEmitter

Enters a new static method

StaticReadonlyField ( string name, string type, string initializer, Access access = Access.Public, bool @new = false ) : void

Creates a static readonly field

Struct ( string name, Access access = Access.Public ) : CSharpEmitter

Enters a struct

Switch ( string expression ) : CSharpEmitter

Enters a switch

WriteLine ( ) : void

Writes a blank line

WriteLine ( string fmt ) : void

Writes a single line to the stream

WriteLineRaw ( string text ) : void

Writes a single line of raw text to the stream

Private Methods

Method Description
CSharpEmitter ( StreamWriter writer, int indent ) : System

Constructs a scoped emitter

_newScope ( ) : CSharpEmitter

Creates a new child scope emitter

Method Details

AbstractProperty() public method

Creates a new abstract property
public AbstractProperty ( string name, string type, Access access = Access.Public ) : void
name string The name of the property
type string The type of the property
access Access The access specifier for the property
return void

Break() public method

Generates a break
public Break ( ) : void
return void

CSharpEmitter() public method

Constructs a new csharp emitter
public CSharpEmitter ( string path ) : System
path string
return System

Case() public method

Generates a case
public Case ( string expression ) : void
expression string The case expression
return void

Class() public method

Enters a class
public Class ( string name, bool isAbstract = false, string bases = null, Access access = Access.Public ) : CSharpEmitter
name string The name of the class
isAbstract bool
bases string The base types
access Access
return CSharpEmitter

Constructor() public method

Enters a new constructor
public Constructor ( string name, Parameter parameters, Access access = Access.Public, bool deferDefault = false ) : CSharpEmitter
name string The type name
parameters Parameter The constructor parameters
access Access
deferDefault bool
return CSharpEmitter

Default() public method

Enters a default case
public Default ( ) : void
return void

Dispose() public method

Disposes of the emitter
public Dispose ( ) : void
return void

EmitUsing() public method

Emits a using clause
public EmitUsing ( string ns ) : void
ns string The namespace
return void

Enum() public method

Enters an enum
public Enum ( string name, string baseType = "uint" ) : CSharpEmitter
name string The name of the enum
baseType string The base type
return CSharpEmitter

EnumValue() public method

Generates an enumeration value
public EnumValue ( string name, int value, bool last = false ) : void
name string The name of the value
value int The value
last bool
return void

IndentString() public method

Retrieves the current indentation string
public IndentString ( int modifier ) : string
modifier int The modifier to apply to the indentation level
return string

Namespace() public method

Enters a namespace
public Namespace ( string ns ) : CSharpEmitter
ns string The namespace
return CSharpEmitter

OverrideProperty() public method

Overrides a get-only property
public OverrideProperty ( string name, string type, string body, Access access = Access.Public ) : void
name string The name of the property
type string The type of the property
body string The body of the property accessor
access Access The access level of the property
return void

Property() public method

Creates a new property
public Property ( string name, string type, Access access = Access.Public, Access setter = Access.Private ) : void
name string The name of the property
type string The type of the property
access Access The access specifier for the property
setter Access The setter specifier for the property
return void

Property() public method

Creates a new get-only property
public Property ( string name, string type, string body, Access access = Access.Public ) : void
name string The name of the property
type string The type of the property
body string The body of the property
access Access The access specifier for the property
return void

StaticMethod() public method

Enters a new static method
public StaticMethod ( string name, string returnType, Parameter parameters, Access access = Access.Public, bool @new = false ) : CSharpEmitter
name string The name of the method
returnType string The return type of the method
parameters Parameter The parameters of the method
access Access The access specifier of the method
@new bool
return CSharpEmitter

StaticReadonlyField() public method

Creates a static readonly field
public StaticReadonlyField ( string name, string type, string initializer, Access access = Access.Public, bool @new = false ) : void
name string The name of the field
type string The type of the field
initializer string
access Access The access specifier for the field
@new bool
return void

Struct() public method

Enters a struct
public Struct ( string name, Access access = Access.Public ) : CSharpEmitter
name string The name of the struct
access Access The access specifier for the struct
return CSharpEmitter

Switch() public method

Enters a switch
public Switch ( string expression ) : CSharpEmitter
expression string The expression to switch on
return CSharpEmitter

WriteLine() public method

Writes a blank line
public WriteLine ( ) : void
return void

WriteLine() public method

Writes a single line to the stream
public WriteLine ( string fmt ) : void
fmt string The format string
return void

WriteLineRaw() public method

Writes a single line of raw text to the stream
public WriteLineRaw ( string text ) : void
text string The text to write
return void