Saves a list of settings.
Use this AdditionalSetting to save a list of additional settings in the default config.
Наследование: AdditionalSetting
Пример #1
0
 protected AdditionalSetting(AdditionalSettingTypes type)
 {
     NameValue = null;
     BaseValue = null;
     BaseUnitValue = null;
     TypeValue = type;
 }
Пример #2
0
 private AdditionalSetting(String name, AdditionalListSetting baseSetting)
 {
     if (name.IndexOf('.') > -1)
         throw new ArgumentOutOfRangeException("name", "'.' isn't allowed in setting names");
     NameValue = name;
     BaseValue = baseSetting;
     baseSetting.ListValue.Add(this);
 }
Пример #3
0
 private void CheckOperConfig(AdditionalListSetting config)
 {
     if (config.ListValue.ContainsSetting("Active", AdditionalSettingTypes.Boolean))
         ActiveValue = (AdditionalBooleanSetting)config.ListValue["Active"];
     else
     {
         ActiveValue = new AdditionalBooleanSetting();
         ActiveValue.Name = "Active";
         ActiveValue.BooleanValue = false;
         config.ListValue.Add(ActiveValue);
     }
 }
Пример #4
0
 public OperConfiguration(AdditionalListSetting baseData)
 {
     if (baseData.Name != "Oper") throw new ArgumentOutOfRangeException("baseData is no oper configuration");
     try
     {
         OperNameValue = (String)baseData.ListValue["OperName"].Value;
         EnabledValue = (Boolean)baseData.ListValue["Enabled"].Value;
     }
     catch (Exception e)
     {
         throw new ArgumentOutOfRangeException("Missing option for opersettings", e);
     }
 }
Пример #5
0
 private void OperSettingPanel_CurrentConfigurationUnitChanged(object sender, EventArgs args)
 {
     AdditionalListSetting config;
     if (CurrentConfigurationUnit.AdditionalSettings.ListValue.ContainsSetting("Oper", AdditionalSettingTypes.List))
     {
         config = (AdditionalListSetting)CurrentConfigurationUnit.AdditionalSettings.ListValue["Oper"];
     }
     else
     {
         config = new AdditionalListSetting();
         config.Name = "Oper";
         CurrentConfigurationUnit.AdditionalSettings.ListValue.Add(config);
     }
     CheckOperConfig(config);
     OperActive.Checked = ActiveValue.BooleanValue;
 }
 public NetworkManagerConfigurationUnit()
 {
     AdditionalSettingsValue = new AdditionalListSetting();
 }