Autogenerated by MFractor v3.2.17

Create AttributeUsage Annotation

Configuration Id: com.mfractor.code_gen.csharp.attribute_usage_annotation

Create an [System.AttributeUsage()] annotation that can can be attached to a class declaration that derives from System.Attribute.

Create Base Constructor

Configuration Id: com.mfractor.code_gen.csharp.base_constructor

Generates a class constructor that routes a series of constructor parameters into a base(...) constructor.

Uses:

Create Class Declaration

Configuration Id: com.mfractor.code_gen.csharp.class_declaration

Generates a new class declaration implementing all provided members, base class constructors, base class abstract invocations and interfaces

Configurable Properties

Name Type Defaults To Description
ImplementBaseConstructors Boolean False Should the base class constructors be automatically created?

Uses:

Create Constructor

Configuration Id: com.mfractor.code_gen.csharp.constructor

Generates a class constructor, optionally with a set of arguments.

Configurable Properties

Name Type Defaults To Description
ArgumentFirstLetterToLowerCase Boolean True Should all constructor arguments have their first letter forced to lower case?

Generate Assignment Expression

Configuration Id: com.mfractor.code_gen.csharp.assignment_expression

Generates an assignment expresssion; eg this.myField = value;

Configurable Properties

Name Type Defaults To Description
IncludeThisForMembers Boolean False When assigning to a class member, should a this. be added to the variable being assigned?

Generate Event Handler Declaration

Configuration Id: com.mfractor.code_gen.csharp.event_handler_declaration

Generates an event EventHandler<EventArgs> declaration that can be bound against by a callback.

Configurable Properties

Name Type Defaults To Description
Snippet Code Snippet

Arguments:
  • name: The name of the new event handler.
  • type: The fully qualified type of the event arguments.
public event EventHandler<$type> $name$; What is the code snippet to use when creating a new event handler?

Generate Event Handler Method

Configuration Id: com.mfractor.code_gen.csharp.event_handler_method

Generates a method that's compatible for registration with an EventHandler<EventArgs> as a callback.

Configurable Properties

Name Type Defaults To Description
Snippet Code Snippet

Arguments:
  • name: The name of the new method.
  • type: The fully qualified type of the event arguments.
public void $name$(object sender, $type$ e)
{
throw new System.NotImplementedException();
}
What is the code snippet to use when creating the new event handler method declaration?

Generate Instance Property

Configuration Id: com.mfractor.code_gen.csharp.instance_property

Generates a instance property with a getter and setter.

Configurable Properties

Name Type Defaults To Description
Snippet Code Snippet

Arguments:
  • type: The fully qualified type of the new property.
  • name: The name of the new propety.
  • value: The value to assign to the new property.
public $type$ $name$
{
get;
set;
}
What is the code snippet to use when creating the property declaration?

Generate Member Initialiser

Configuration Id: com.mfractor.code_gen.csharp.member_initialiser_expression

Generates an initilisation expression for a class/struct member (such as a property or field).

Configurable Properties

Name Type Defaults To Description
ForceStringLiteral Boolean False Should the code generator always attempt to assign members with a string literal?

Member Field Generator

Configuration Id: com.mfractor.code_gen.csharp.field_declaration

Generates member field declarations with an optional value initialisation

Configurable Properties

Name Type Defaults To Description
UnderscoreOnBackingField Boolean False When creating a backing field for a property, should the field have an underscore appended to the start of the field name?

Uses:

Method Generator

Configuration Id: com.mfractor.code_gen.csharp.method_declaration

Generates a new method declaration

Configurable Properties

Name Type Defaults To Description
UseExplicitInterfaceImplementation Boolean False When generating a method for an interface, should the new method be explicitly qualified against the interface? EG: 'void MyInterface.MyMethod'
IncludeNotImplementException Boolean False When creating the new method body, should a NotImplementedException be thrown as the default code body?

Namespace Declaration

Configuration Id: com.mfractor.code_gen.csharp.namespace_declaration

Generates a new namespace declaration syntax element

Using Directive Generator

Configuration Id: com.mfractor.code_gen.csharp.using_directive

Generates a new using directive for the provided namespace