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