- Modified DNAClassAttribute to also support usage on structs
- Added auto generation of DNAClass attributes on file generation - Regenerated all files
This commit is contained in:
@@ -81,6 +81,10 @@ namespace CodeGenerator {
|
||||
|
||||
//Create a new type declaration
|
||||
var ctd = new CodeTypeDeclaration(type.Type);
|
||||
ctd.CustomAttributes.Add(new CodeAttributeDeclaration("DNAClassAttribute",
|
||||
new CodeAttributeArgument(new CodePrimitiveExpression(type.IdxType)),
|
||||
new CodeAttributeArgument(new CodePrimitiveExpression(type.Type))
|
||||
));
|
||||
|
||||
foreach (var field in type.Fields) {
|
||||
if (field.Name.Contains("*")) {
|
||||
@@ -247,7 +251,7 @@ namespace CodeGenerator {
|
||||
};
|
||||
ctd.BaseTypes.Add(new CodeTypeReference(typeof(Attribute)));
|
||||
ctd.CustomAttributes.Add(new("AttributeUsage",
|
||||
new CodeAttributeArgument(new CodeSnippetExpression("AttributeTargets.Class"))));
|
||||
new CodeAttributeArgument(new CodeSnippetExpression("AttributeTargets.Class | AttributeTargets.Struct"))));
|
||||
|
||||
|
||||
var cmf = new CodeMemberField(typeof(int), "_originalIndex") {
|
||||
|
||||
Reference in New Issue
Block a user