Changed attribute builder to derive from correct class, also added method to pass base class parameters using string refs. Regenerated the files
This commit is contained in:
@@ -300,10 +300,10 @@ namespace CodeGenerator {
|
||||
private static CodeTypeDeclaration[] GenerateTypeDeclarations() {
|
||||
var attributeBuilder = new AttributeBuilder();
|
||||
|
||||
var typeDeclarations = new CodeTypeDeclaration[] {
|
||||
var typeDeclarations = new[] {
|
||||
attributeBuilder.New().SetName("DNAAttribute")
|
||||
.SetAttributeUsage(new (new CodeSnippetExpression("AttributeTargets.All")))
|
||||
.DeriveFromClass("System.Attribute")
|
||||
.DeriveFromClass()
|
||||
.AddAutoProperty(typeof(int), "OriginalIndex")
|
||||
.AddAutoProperty(typeof(string), "OriginalName")
|
||||
.AddPropertiesConstructor()
|
||||
@@ -319,6 +319,7 @@ namespace CodeGenerator {
|
||||
.AddAutoProperty(typeof(bool), "IsPointer")
|
||||
.AddAutoProperty(typeof(int), "MemoryOffset")
|
||||
.AddPropertiesConstructor()
|
||||
.AddBaseConstructorParams(["OriginalIndex", "OriginalName"])
|
||||
.Build(),
|
||||
attributeBuilder.New().SetName("DNAClassAttribute")
|
||||
.SetAttributeUsage(new (new CodeSnippetExpression("AttributeTargets.Class | AttributeTargets.Struct")))
|
||||
@@ -327,6 +328,7 @@ namespace CodeGenerator {
|
||||
.AddAutoProperty(typeof(string), "OriginalName")
|
||||
.AddAutoProperty(typeof(int), "Size")
|
||||
.AddPropertiesConstructor()
|
||||
.AddBaseConstructorParams(["OriginalIndex", "OriginalName"])
|
||||
.Build(),
|
||||
attributeBuilder.New().SetName("DNAListAttribute")
|
||||
.SetAttributeUsage(new (new CodeSnippetExpression("AttributeTargets.Property | AttributeTargets.Field")))
|
||||
@@ -340,6 +342,7 @@ namespace CodeGenerator {
|
||||
.AddAutoProperty(typeof(int), "CountFieldIndex")
|
||||
.AddAutoProperty(typeof(int), "MemoryOffset")
|
||||
.AddPropertiesConstructor()
|
||||
.AddBaseConstructorParams(["OriginalIndex", "OriginalName"])
|
||||
.Build()
|
||||
};
|
||||
return typeDeclarations;
|
||||
|
||||
Reference in New Issue
Block a user