主要通过actions.txt添加按钮说明
然后通过config的AddActions-Utils.GetResource加载。
private static void AddActions(Assembly assembly)
{
var content = Utils.GetResource(assembly, "actions");
if (string.IsNullOrWhiteSpace(content))
return;
var lines = content.Split([.. Environment.NewLine]);
if (lines == null || lines.Length == 0)
return;
foreach (var item in lines)
{
if (string.IsNullOrWhiteSpace(item))
continue;
var values = item.Split('|');
if (values.Length < 2)
continue;
var id = values[0].Trim();
var info = Actions.FirstOrDefault(i => i.Id == id);
if (info == null)
{
info = new ActionInfo { Id = id };
Actions.Add(info);
}
if (values.Length > 1)
info.Name = values[1].Trim();
if (values.Length > 2)
info.Icon = values[2].Trim();
if (values.Length > 3)
info.Style = values[3].Trim();
}
}
标签:info,Trim,工具栏,lines,var,Length,values,按钮,known From: https://www.cnblogs.com/chenchen113/p/18355188