mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Start adding enum helpers
This commit is contained in:
24
SabreTools.Core/MappingAttribute.cs
Normal file
24
SabreTools.Core/MappingAttribute.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
|
||||
namespace SabreTools.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Maps a set of strings to an enum value
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false)]
|
||||
public class MappingAttribute : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// Set of mapping strings
|
||||
/// </summary>
|
||||
public string[] Mappings { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
public MappingAttribute(params string[] mappings)
|
||||
{
|
||||
this.Mappings = mappings;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user