71 lines
1.7 KiB
C#
71 lines
1.7 KiB
C#
using System;
|
|
|
|
namespace NBF
|
|
{
|
|
public abstract class BaseAttribute : Attribute
|
|
{
|
|
}
|
|
|
|
[AttributeUsage(AttributeTargets.Class)]
|
|
public class UIBindAttribute : BaseAttribute
|
|
{
|
|
public int Id;
|
|
|
|
public UIBindAttribute(int id)
|
|
{
|
|
this.Id = id;
|
|
}
|
|
}
|
|
|
|
[AttributeUsage(AttributeTargets.Field)]
|
|
public class InputIconAttribute : BaseAttribute
|
|
{
|
|
public string KeyBoardIcon;
|
|
public string ControllerIcon;
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <param name="keyBoardIcon">键盘图标</param>
|
|
/// <param name="controllerIcon">控制器图标</param>
|
|
public InputIconAttribute(string keyBoardIcon, string controllerIcon)
|
|
{
|
|
KeyBoardIcon = keyBoardIcon;
|
|
ControllerIcon = controllerIcon;
|
|
}
|
|
}
|
|
|
|
|
|
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Class, AllowMultiple = true)]
|
|
public class TitleAttribute : BaseAttribute
|
|
{
|
|
public string Title;
|
|
|
|
public TitleAttribute(string title)
|
|
{
|
|
Title = title;
|
|
}
|
|
}
|
|
|
|
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Class, AllowMultiple = true)]
|
|
public class DescriptionAttribute : BaseAttribute
|
|
{
|
|
public string Description;
|
|
|
|
public DescriptionAttribute(string description)
|
|
{
|
|
Description = description;
|
|
}
|
|
}
|
|
|
|
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Class, AllowMultiple = true)]
|
|
public class SortAttribute : BaseAttribute
|
|
{
|
|
public int Sort;
|
|
|
|
public SortAttribute(int sort)
|
|
{
|
|
Sort = sort;
|
|
}
|
|
}
|
|
} |