示例#1
0
        public static Setting Create(I18N.I18NString description, bool value, SettingDependency dependency = null)
        {
            var setting = new Setting()
            {
                Type         = SettingType.BOOLEAN,
                Value        = value ? "1" : "0",
                DefaultValue = value ? "1" : "0",
                Description  = description,
                Dependency   = dependency
            };

            return(setting);
        }
示例#2
0
        public static Setting Create(I18N.I18NString description, string value, SettingDependency dependency = null)
        {
            var setting = new Setting()
            {
                Type         = SettingType.STRING,
                Value        = value,
                DefaultValue = value,
                Description  = description,
                Dependency   = dependency
            };

            return(setting);
        }
示例#3
0
 public SettingCategory(I18N.I18NString title, I18N.I18NString description, SettingDependency dependency = null)
 {
     Title       = title;
     Description = description;
     Dependency  = dependency;
 }
示例#4
0
 public SettingCategory(I18N.I18NString title, SettingDependency dependency = null)
 {
     Title      = title;
     Dependency = dependency;
 }
示例#5
0
        public static Setting Create(I18N.I18NString description, OrderedDictionary <string, I18N.I18NString> allowedValues, string defaultvalue, SettingDependency dependency = null)
        {
            var setting = new Setting()
            {
                Type         = SettingType.ENUM,
                Value        = defaultvalue,
                DefaultValue = defaultvalue,
                Description  = description,
                Dependency   = dependency
            };

            foreach (var allowedValue in allowedValues)
            {
                setting.AllowedValues.Add(allowedValue.Key, allowedValue.Value);
            }
            return(setting);
        }