Class CSharpProperty
- Namespace
- NanoByte.CodeGeneration
- Assembly
- NanoByte.CodeGeneration.dll
A property on a CSharpInterface or CSharpClass.
public class CSharpProperty
- Inheritance
-
objectCSharpProperty
Constructors
CSharpProperty(CSharpIdentifier, string)
A property on a CSharpInterface or CSharpClass.
public CSharpProperty(CSharpIdentifier type, string name)
Parameters
typeCSharpIdentifierThe type of the property.
namestringThe name of the property.
Properties
Attributes
Attributes to apply to the property.
public List<CSharpAttribute> Attributes { get; }
Property Value
GetterExpression
An expression body for the property's getter.
public CSharpObjectCreation? GetterExpression { get; set; }
Property Value
Remarks
Mutually exclusive with Initializer and InitializerExpression.
HasSetter
Indicates whether the property has a setter.
public bool HasSetter { get; set; }
Property Value
Initializer
The property's initializer (sets default value).
public CSharpObjectCreation? Initializer { get; set; }
Property Value
Remarks
Mutually exclusive with InitializerExpression and GetterExpression.
InitializerExpression
The property's initializer as a raw C# expression (e.g. null!).
public string? InitializerExpression { get; set; }
Property Value
Remarks
Mutually exclusive with Initializer and GetterExpression.
IsRequired
Indicates whether the property is marked with the required modifier.
public bool IsRequired { get; set; }
Property Value
Name
The name of the property.
public string Name { get; }
Property Value
Summary
A summary used for an XML documentation comment.
public string? Summary { get; set; }
Property Value
Type
The type of the property.
public CSharpIdentifier Type { get; }
Property Value
Methods
ToString()
Returns the name of the property.
public override string ToString()