Beispiel #1
0
 /// <summary>
 /// Adds a custom setting
 /// </summary>
 /// <param name="setting">PowerSetting to add</param>
 public void AddSetting(PowerSetting setting)
 {
     if (_settings.ContainsKey(setting.Name))
     {
         throw new ArgumentException("settings already contain key", setting.Name);
     }
     _settings.Add(setting.Name, setting);
 }
Beispiel #2
0
 /// <summary>
 /// Gets a custom PowerScheduler setting
 /// </summary>
 /// <param name="name">setting name</param>
 /// <returns>requested PowerSetting</returns>
 public PowerSetting GetSetting(string name)
 {
     if (_settings.ContainsKey(name))
     {
         return(_settings[name]);
     }
     else
     {
         PowerSetting setting = new PowerSetting(name);
         AddSetting(setting);
         return(setting);
     }
 }