Open sandboxFocus

Enum ConstructorInitializerKind

Describes the kind of constructor initializer. A constructor initializer is the optional : base(...) or : this(...) clause that appears after the constructor parameter list and invokes another constructor before the current constructor body executes.

Namespace: Metalama.Framework.Code
Assembly: Metalama.Framework.dll
Syntax
[CompileTime]
public enum ConstructorInitializerKind
Remarks

For example, in public MyClass() : base(42) { }, the : base(42) part is a constructor initializer of kind Base.

In public MyClass(int x) : this() { }, the : this() part is a constructor initializer of kind This.

Fields

Name Description
Base

The constructor invokes a constructor of the base class, either explicitly via a : base(...) initializer or implicitly when the instance constructor has no explicit initializer and the declaring type is a reference type.

None

The constructor has no initializer calling a base or sibling constructor. This applies to value types (structs) and static constructors, which never have a base or this initializer. For instance constructors of reference types (classes), the C# compiler always implicitly calls a base constructor, so Base is returned instead.

This

The constructor has a : this(...) initializer that invokes another constructor of the same type.

See Also