ButtonIcon.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. namespace Bowin.Web.Controls.Mvc
  6. {
  7. public class ButtonIconHelper
  8. {
  9. protected static Dictionary<ButtonIcon, string> DictButtonIcon = new Dictionary<ButtonIcon, string>();
  10. protected static string DefaultButtonIconClass = "icon-app";
  11. static ButtonIconHelper()
  12. {
  13. DictButtonIcon.Add(ButtonIcon.Add, "icon-add");
  14. DictButtonIcon.Add(ButtonIcon.Edit, "icon-edit");
  15. DictButtonIcon.Add(ButtonIcon.Delete, "icon-remove");
  16. DictButtonIcon.Add(ButtonIcon.App, "icon-ok");
  17. DictButtonIcon.Add(ButtonIcon.Search, "icon-search");
  18. DictButtonIcon.Add(ButtonIcon.Print, "icon-print");
  19. DictButtonIcon.Add(ButtonIcon.Save, "icon-save");
  20. }
  21. public static string GetButtonIconClass(ButtonIcon buttonIcon)
  22. {
  23. if (DictButtonIcon.ContainsKey(buttonIcon))
  24. {
  25. return DictButtonIcon[buttonIcon];
  26. }
  27. else
  28. {
  29. return DefaultButtonIconClass;
  30. }
  31. }
  32. }
  33. }