Align.cs 673 B

12345678910111213141516171819202122232425262728
  1. using System.Collections.Generic;
  2. namespace Bowin.Web.Controls.Mvc
  3. {
  4. public class AlignStyleHelper
  5. {
  6. protected static Dictionary<AlignStyle, string> DictAlignStyle = new Dictionary<AlignStyle, string>();
  7. protected static string DefaultAlignStyle = "left";
  8. static AlignStyleHelper()
  9. {
  10. DictAlignStyle.Add(AlignStyle.Left, "left");
  11. DictAlignStyle.Add(AlignStyle.Right, "right");
  12. DictAlignStyle.Add(AlignStyle.Center, "center");
  13. }
  14. public static string GetAlignStyleHtml(AlignStyle alignStyle)
  15. {
  16. if (DictAlignStyle.ContainsKey(alignStyle))
  17. {
  18. return DictAlignStyle[alignStyle];
  19. }
  20. else
  21. {
  22. return DefaultAlignStyle;
  23. }
  24. }
  25. }
  26. }