public DistinctOptionInfo(string section, string name, string defaultValue, string[] validValues,
		                           Action<string> onChange = null, ConfigFile configFile = null)
            : base(section, name, defaultValue, onChange, configFile)
        {
            ValidValues = new HashSet<string> (validValues);
            ValidValues.Add (defaultValue);
        }
        public BooleanOptionInfo(string section, string name, bool defaultValue, Action<bool> onChange = null,
		                          ConfigFile configFile = null)
            : base(section, name, defaultValue?ConfigFile.True:ConfigFile.False, ValidValues, null, configFile)
        {
            if (onChange != null) {
                OnChange = (str) => onChange (str == ConfigFile.True);
            }
        }
Beispiel #3
0
        public OptionInfo(string section, string name, string defaultValue, Action<string> onChange = null,
		                   ConfigFile configFile = null)
        {
            Section = section;
            Name = name;
            DefaultValue = defaultValue;
            ConfigFile = configFile != null ? configFile : Options.Default;
            OnChange = onChange != null ? onChange : (str) => {};
        }