From 9e27a1925843862d9d99d5781fed5a038c532edf Mon Sep 17 00:00:00 2001 From: ww-rm Date: Mon, 31 Mar 2025 14:37:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=81=E8=AE=B8=E5=A4=9A=E6=A0=87=E8=AE=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SpineViewer/Exporter/ExportHelper.cs | 2 +- SpineViewer/ImplementationResolver.cs | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/SpineViewer/Exporter/ExportHelper.cs b/SpineViewer/Exporter/ExportHelper.cs index ec889e3..0f08d62 100644 --- a/SpineViewer/Exporter/ExportHelper.cs +++ b/SpineViewer/Exporter/ExportHelper.cs @@ -25,7 +25,7 @@ namespace SpineViewer.Exporter /// /// 导出实现类标记 /// - [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)] + [AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = false)] public class ExportImplementationAttribute(ExportType exportType) : Attribute, IImplementationKey { public ExportType ImplementationKey { get; private set; } = exportType; diff --git a/SpineViewer/ImplementationResolver.cs b/SpineViewer/ImplementationResolver.cs index 07eea04..977088d 100644 --- a/SpineViewer/ImplementationResolver.cs +++ b/SpineViewer/ImplementationResolver.cs @@ -32,8 +32,7 @@ namespace SpineViewer var impTypes = Assembly.GetExecutingAssembly().GetTypes().Where(t => baseType.IsAssignableFrom(t) && !t.IsAbstract); foreach (var type in impTypes) { - var attr = type.GetCustomAttribute(); - if (attr is not null) + foreach (var attr in type.GetCustomAttributes()) { var key = attr.ImplementationKey; if (ImplementationTypes.ContainsKey(key))