Exemple #1
0
 public UserSettingBool(
     string id,
     Func <string> nameF,
     Func <string> descriptionF,
     UserSettingGroup group,
     Func <TProfile, bool> loadF,
     Action <TProfile, bool> applyF) : base(id, nameF, descriptionF, group, loadF, applyF)
 {
 }
Exemple #2
0
 protected UserSettingBase(string id,
                           Func <string> nameF,
                           Func <string> descriptionF,
                           UserSettingGroup group,
                           Func <TProfile, TValue> loadF,
                           Action <TProfile, TValue> applyF,
                           Func <string> unitsF = null) : base(id, nameF, descriptionF, group, unitsF)
 {
     this.applyF = applyF;
     this.loadF  = loadF;
 }
 protected UserSettingBase(string id,
                           Func <string> nameF,
                           Func <string> descriptionF = null,
                           UserSettingGroup group     = null,
                           Func <string> unitsF       = null)
 {
     Id           = id;
     NameF        = nameF;
     DescriptionF = descriptionF;
     Group        = group;
     UnitsF       = unitsF;
 }
 public UserSettingEnum(
     string id,
     Func <string> nameF,
     Func <string> descriptionF,
     UserSettingGroup group,
     Func <TProfile, int> loadF,
     Action <TProfile, int> applyF,
     IEnumerable <UserSettingEnumOption> options) :
     base(id, nameF, descriptionF, group, loadF, applyF)
 {
     Options = new ReadOnlyCollection <UserSettingEnumOption>(options.ToList());
 }
Exemple #5
0
 public UserSettingInt(
     string id,
     Func <string> nameF,
     Func <string> descriptionF,
     UserSettingGroup group,
     Func <TProfile, int> loadF,
     Action <TProfile, int> applyF,
     Func <string> unitsF       = null,
     NumericInfoInt numericInfo = null) :
     base(id, nameF, descriptionF, group, loadF, applyF, unitsF)
 {
     NumericInfo = numericInfo;
 }
 public UserSettingString(
     string id,
     Func <string> nameF,
     Func <string> descriptionF,
     UserSettingGroup group,
     Func <TProfile, string> loadF,
     Action <TProfile, string> applyF,
     IEnumerable <Func <string, ValidationResult> > validations = null,
     Func <string> unitsF = null) : base(id, nameF, descriptionF, group, loadF, applyF, unitsF)
 {
     Validations = new List <Func <string, ValidationResult> >();
     if (validations != null)
     {
         Validations.AddRange(validations);
     }
 }
Exemple #7
0
 public UserSettingDouble(
     string id,
     Func <string> nameF,
     Func <string> descriptionF,
     UserSettingGroup group,
     Func <TProfile, double> loadF,
     Action <TProfile, double> applyF,
     Func <string> unitsF          = null,
     NumericInfoDouble numericInfo = null,
     bool convertToPercentage      = false,
     int decimalDigits             = 2) :
     base(id, nameF, descriptionF, group, loadF, applyF, unitsF)
 {
     NumericInfo         = numericInfo;
     ConvertToPercentage = convertToPercentage;
     DecimalDigits       = decimalDigits;
 }
Exemple #8
0
 public UserSettingDoubleListVariableLength(
     string id,
     Func <string> nameF,
     Func <string> descriptionF,
     UserSettingGroup group,
     Func <TProfile, List <double> > loadF,
     Action <TProfile, List <double> > applyF,
     int?minimumCount              = null,
     int?maximumCount              = null,
     Func <string> unitsF          = null,
     NumericInfoDouble numericInfo = null,
     bool convertToPercentage      = false,
     int decimalDigits             = 2) :
     base(id, nameF, descriptionF, group, loadF, applyF, unitsF)
 {
     MinimumCount        = minimumCount ?? 1;
     MaximumCount        = maximumCount ?? 100;
     NumericInfo         = numericInfo;
     ConvertToPercentage = convertToPercentage;
     DecimalDigits       = decimalDigits;
 }