Exemplo n.º 1
0
 public void Add(INapsOption option)
 {
     if (option is null)
     {
         throw new ArgumentNullException(nameof(option));
     }
     this[option.Key] = option;
 }
Exemplo n.º 2
0
 public void Toggle(INapsOption option, bool value)
 {
     Remove(option);
     if (value)
     {
         Add(option);
     }
 }
Exemplo n.º 3
0
        public bool Remove(INapsOption option)
        {
            if (option is null)
            {
                throw new ArgumentNullException(nameof(option));
            }

            return(Remove(option.Key));
        }
Exemplo n.º 4
0
        public bool TryGetValue(string key, out INapsOption option)
        {
            var idx = FindKeyIndex(key);

            if (idx == -1)
            {
                option = null;
                return(false);
            }
            option = _options[idx];
            return(true);
        }
Exemplo n.º 5
0
 private Naps2ScanJob AddOption(INapsOption option, bool enabled = true)
 {
     Args.Toggle(option, enabled);
     return(this);
 }