using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Bowin.Web.Controls.Mvc { public class Toolbar:BaseControl { public Toolbar() { ButtonList = new List(); } public IList ButtonList { get; private set; } public override string Render() { StringBuilder htmlBuilder = new StringBuilder(); htmlBuilder.AppendLine("
"); foreach (var button in ButtonList) { htmlBuilder.AppendLine(button.Render()); } htmlBuilder.AppendLine("
"); return htmlBuilder.ToString(); } public static Toolbar CreateControl(ToolbarOptions toolbarOptions, IDictionary attributes = null) { Toolbar toolbar = new Toolbar(); foreach (var b in toolbarOptions.ButtonList) { toolbar.ButtonList.Add(b); } return toolbar; } } }