Added BaseType "Attribute" to DNAClassAttribute generator function and regenerated the source.

This commit is contained in:
Samuele Lorefice
2025-01-23 16:09:33 +01:00
parent bf1eb8201c
commit 7c0708b377
2 changed files with 3 additions and 1 deletions

View File

@@ -13,7 +13,7 @@ using System;
namespace BlendFile { namespace BlendFile {
[AttributeUsage(AttributeTargets.Class)] [AttributeUsage(AttributeTargets.Class)]
public class DNAClassAttribute { public class DNAClassAttribute : System.Attribute {
private int _originalIndex; private int _originalIndex;
public virtual int OriginalIndex { public virtual int OriginalIndex {
get { get {

View File

@@ -245,8 +245,10 @@ namespace CodeGenerator {
IsClass = true, IsClass = true,
Attributes = MemberAttributes.Public Attributes = MemberAttributes.Public
}; };
ctd.BaseTypes.Add(new CodeTypeReference(typeof(Attribute)));
ctd.CustomAttributes.Add(new("AttributeUsage", ctd.CustomAttributes.Add(new("AttributeUsage",
new CodeAttributeArgument(new CodeSnippetExpression("AttributeTargets.Class")))); new CodeAttributeArgument(new CodeSnippetExpression("AttributeTargets.Class"))));
var cmf = new CodeMemberField(typeof(int), "_originalIndex") { var cmf = new CodeMemberField(typeof(int), "_originalIndex") {
Attributes = MemberAttributes.Private Attributes = MemberAttributes.Private