public IEnumerable <T> IndexEnumerable(string keyName, IDictionary <string, ulong> labels) { try { return(IndexEnumerable(Hash40Util.LabelToHash40(keyName, labels))); } catch (KeyNotFoundException) { throw new KeyNotFoundException($"The given key '{keyName}' was not present in the dictionary."); } }
public void Add(string keyName, IDictionary <string, ulong> labels, T value) { try { Add(Hash40Util.LabelToHash40(keyName, labels), value); } catch (ArgumentException) { throw new ArgumentException($"An item with the key '{keyName}' has already been added"); } }
public void SetValue(string value, IDictionary <string, ulong> labels) { switch (TypeKey) { case ParamType.@bool: Value = bool.Parse(value); break; case ParamType.@sbyte: Value = sbyte.Parse(value); break; case ParamType.@byte: Value = byte.Parse(value); break; case ParamType.@short: Value = short.Parse(value); break; case ParamType.@ushort: Value = ushort.Parse(value); break; case ParamType.@int: Value = int.Parse(value); break; case ParamType.@uint: Value = uint.Parse(value); break; case ParamType.@float: Value = float.Parse(value); break; case ParamType.hash40: Value = Hash40Util.LabelToHash40(value, labels); break; case ParamType.@string: Value = value; break; } }
public T this[string keyName, IDictionary <string, ulong> labels] { get { try { return(this[Hash40Util.LabelToHash40(keyName, labels)]); } catch (KeyNotFoundException) { throw new KeyNotFoundException($"The given key '{keyName}' was not present in the dictionary."); } } set { try { this[Hash40Util.LabelToHash40(keyName, labels)] = value; } catch (KeyNotFoundException) { throw new KeyNotFoundException($"The given key '{keyName}' was not present in the dictionary."); } } }
public bool ContainsKey(string keyName, IDictionary <string, ulong> labels) { return(ContainsKey(Hash40Util.LabelToHash40(keyName, labels))); }