zhaolei
2020-11-20 921de2254ff5712a44ed8575ee8efe34252f6603
commit | author | age
921de2 1 namespace Bootstrap.Admin.Pages.Components
Z 2 {
3     /// <summary>
4     /// CheckBox 组件状态枚举值
5     /// </summary>
6     public enum CheckBoxState
7     {
8         /// <summary>
9         /// 未选中
10         /// </summary>
11         UnChecked,
12         /// <summary>
13         /// 选中
14         /// </summary>
15         Checked,
16         /// <summary>
17         /// 混合模式
18         /// </summary>
19         Mixed
20     }
21
22     /// <summary>
23     /// 
24     /// </summary>
25     public static class CheckBoxStateExtensions
26     {
27         /// <summary>
28         /// 
29         /// </summary>
30         /// <param name="state"></param>
31         /// <returns></returns>
32         public static string ToCss(this CheckBoxState state)
33         {
34             var ret = "false";
35             switch (state)
36             {
37                 case CheckBoxState.Checked:
38                     ret = "true";
39                     break;
40                 case CheckBoxState.Mixed:
41                     ret = "mixed";
42                     break;
43                 case CheckBoxState.UnChecked:
44                     break;
45             }
46             return ret;
47         }
48     }
49 }