123456789101112131415161718192021222324252627282930313233343536373839404142 |
- 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<ToolbarButton>();
- }
- public IList<ToolbarButton> ButtonList { get; private set; }
- public override string Render()
- {
- StringBuilder htmlBuilder = new StringBuilder();
- htmlBuilder.AppendLine("<div class=\"current_navbar toolbar\"> <div class=\"func_info\">");
- foreach (var button in ButtonList)
- {
- htmlBuilder.AppendLine(button.Render());
- }
- htmlBuilder.AppendLine("</div></div>");
- return htmlBuilder.ToString();
- }
- public static Toolbar CreateControl(ToolbarOptions toolbarOptions, IDictionary<string, string> attributes = null)
- {
- Toolbar toolbar = new Toolbar();
- foreach (var b in toolbarOptions.ButtonList)
- {
- toolbar.ButtonList.Add(b);
- }
- return toolbar;
- }
-
- }
- }
|