BotSharp/src/Infrastructure/BotSharp.Abstraction/Plugins/Models/PluginMenuDef.cs

38 lines
960 B
C#
Raw Normal View History

2024-01-12 08:52:50 +00:00
namespace BotSharp.Abstraction.Plugins.Models;
public class PluginMenuDef
{
2024-01-15 21:35:01 +00:00
[JsonIgnore]
public string Id { get; set; }
2024-01-12 08:52:50 +00:00
public string Label { get; set; }
2024-01-15 21:35:01 +00:00
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
2024-01-12 08:52:50 +00:00
public string? Icon { get; set; }
2024-01-15 21:35:01 +00:00
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
2024-01-12 08:52:50 +00:00
public string? Link { get; set; }
2024-01-15 21:35:01 +00:00
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public bool? IsHeader { get; set; }
[JsonIgnore]
2024-01-12 08:52:50 +00:00
public int Weight { get; set; }
2024-01-15 21:35:01 +00:00
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public List<PluginMenuDef>? SubMenu { get; set; }
public PluginMenuDef(string lable, string? link = null, string? icon = null, int weight = 0)
2024-01-12 08:52:50 +00:00
{
Label = lable;
Link = link;
Icon = icon;
Weight = weight;
2024-01-15 21:35:01 +00:00
}
public override string ToString()
{
return $"{Label} {Link} {Weight}";
2024-01-12 08:52:50 +00:00
}
}