mirror of
https://github.com/nsnail/ns-ext.git
synced 2025-06-20 09:38:16 +08:00
refactor: ♻️ 2.0 (#3)
This commit is contained in:
26
src/backend/NSExt/Attributes/LocalizationAttribute.cs
Normal file
26
src/backend/NSExt/Attributes/LocalizationAttribute.cs
Normal file
@ -0,0 +1,26 @@
|
||||
namespace NSExt.Attributes;
|
||||
|
||||
/// <summary>
|
||||
/// 指定本地化资源类型
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Class | AttributeTargets.Field)]
|
||||
public sealed class LocalizationAttribute : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="LocalizationAttribute" /> class.
|
||||
/// </summary>
|
||||
#pragma warning disable IDE0290
|
||||
public LocalizationAttribute(Type resourceClass)
|
||||
#pragma warning restore IDE0290
|
||||
{
|
||||
ResourceClass = resourceClass;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets 资源类型
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// 资源类型
|
||||
/// </value>
|
||||
public Type ResourceClass { get; set; }
|
||||
}
|
Reference in New Issue
Block a user