StructDeclaration Class
Represents a struct declaration.
public class StructDeclaration : ClassOrStructDeclarationExample
var str = new StructDeclaration("Point");
str.Members.Add(new FieldDeclaration("X", typeof(int)));
str.Members.Add(new FieldDeclaration("Y", typeof(int)));
Assert.Equal("""
struct Point
{
int X;
int Y;
}
""", str.ToCsharpString());- Inheritance
ClassOrStructDeclarationStructDeclaration
Constructors
| Name | Description |
|---|---|
| StructDeclaration() | |
| StructDeclaration(string?) | Initializes a new instance of the StructDeclaration class with the specified name. |
StructDeclaration overloads
StructDeclaration()
StructDeclaration.cspublic StructDeclaration()No documentation is available.
StructDeclaration(string?)
StructDeclaration.csInitializes a new instance of the StructDeclaration class with the specified name.
public StructDeclaration(string? name)Parameters
namestring?- The struct name.