Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 3
0
 public SettingCategory(I18N.I18NString title, I18N.I18NString description, SettingDependency dependency = null)
 {
     Title       = title;
     Description = description;
     Dependency  = dependency;
 }
Esempio n. 4
0
 public SettingCategory(I18N.I18NString title, SettingDependency dependency = null)
 {
     Title      = title;
     Dependency = dependency;
 }
Esempio n. 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);
        }