Example #1
0
 /// <summary>
 /// Helper method to get a config parameter.
 /// </summary>
 /// <typeparam name="T">The type of the config parameter.</typeparam>
 /// <param name="key">The config parameter.</param>
 /// <returns>The config parameter, or the default value of type T if the parameter isn't specifed.</returns>
 protected T GetParam <T>(int key)
 {
     if (this.GetParamDelegate == null)
     {
         return(ConfigSetBase.GetValueOrDefault <T>(this.ParamStore.TryGetValue, key));
     }
     else
     {
         return(ConfigSetBase.GetValueOrDefault <T>(this.GetParamDelegate, key));
     }
 }
 /// <summary>
 /// Helper method to get a custom defined engine param.
 /// </summary>
 /// <typeparam name="T">The type of the engine param.</typeparam>
 /// <param name="param">The engine param to get.</param>
 /// <returns>The engine param value.</returns>
 private T GetEngineParam <T>(DatabaseParams param)
 {
     // Engine params are always accessed from the config store dictionary (even if the config set is live)
     return(ConfigSetBase.GetValueOrDefault <T>(this.ParamStore.TryGetValue, (int)param));
 }