using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace Bowin.Web.Controls.Mvc { public class ButtonIconHelper { protected static Dictionary DictButtonIcon = new Dictionary(); protected static string DefaultButtonIconClass = "icon-app"; static ButtonIconHelper() { DictButtonIcon.Add(ButtonIcon.Add, "icon-add"); DictButtonIcon.Add(ButtonIcon.Edit, "icon-edit"); DictButtonIcon.Add(ButtonIcon.Delete, "icon-remove"); DictButtonIcon.Add(ButtonIcon.App, "icon-ok"); DictButtonIcon.Add(ButtonIcon.Search, "icon-search"); DictButtonIcon.Add(ButtonIcon.Print, "icon-print"); DictButtonIcon.Add(ButtonIcon.Save, "icon-save"); } public static string GetButtonIconClass(ButtonIcon buttonIcon) { if (DictButtonIcon.ContainsKey(buttonIcon)) { return DictButtonIcon[buttonIcon]; } else { return DefaultButtonIconClass; } } } }