using System.Collections.Generic; namespace WX.CRM.WebHelper { public class ToolBar { public string[] ShowButton { get; set; } public Dictionary OtherButton { get; set; } /// /// 添加自定义按钮 /// /// public void AddOtherButton(string id, ToolBarButton button) { if (this.OtherButton == null) this.OtherButton = new Dictionary(); this.OtherButton.Add(id, button); } /// /// 添加自定义按钮 /// /// /// /// /// public void AddOtherButton(string id, string text, string icon, string click, bool hr) { if (this.OtherButton == null) this.OtherButton = new Dictionary(); this.OtherButton.Add(id, new ToolBarButton() { id = id, text = text, icon = icon, click = click, hr = hr }); } /// /// 添加自定义按钮 /// /// 控件ID /// 显示文本 /// 样式图标 /// 点击函数名称 /// 是否有分割线 /// 类型 public void AddOtherButton(string id, string text, string icon, string click, bool hr, List child) { if (this.OtherButton == null) this.OtherButton = new Dictionary(); this.OtherButton.Add(id, new ToolBarButton() { id = id, text = text, icon = icon, click = click, hr = hr, child = child }); } /// /// 允许的 /// /// public void AllowButton(params string[] buttons) { ShowButton = buttons; } } public class ToolBarButton { public string id { get; set; } public string text { get; set; } public string icon { get; set; } public string click { get; set; } public bool hr { get; set; } /// /// 普通按钮:ToolButton 下拉按钮:SplitButton /// public List child { get; set; } } public class ToolBarNew { /// /// 按钮颜色 /// public string btnColor { get; set; } /// /// 按钮名称 /// public string btnName { get; set; } } }