Exemplo n.º 1
0
 public RuntimeOptionBase this[RuntimeOptions.Identity identity] {
     get {
         identity.EnsureNotNull(nameof(identity));
         //
         try {
             return(_options[key : identity]);
         }
         catch (KeyNotFoundException exception) {
             throw new KeyNotFoundException(message: $"There is not an option with the specified identity.{Environment.NewLine}\tOption identity:{Environment.NewLine}\t\t{identity}", innerException: exception);
         }
     }
 }
Exemplo n.º 2
0
 public bool TryGetOption(RuntimeOptions.Identity identity, out RuntimeOptionBase option)
 => _options.TryGetValue(key: identity.EnsureNotNull(nameof(identity)).Value, value: out option);