コード例 #1
0
ファイル: Hash40Pairs.cs プロジェクト: zrksyd/paracobNET
 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.");
     }
 }
コード例 #2
0
ファイル: Hash40Pairs.cs プロジェクト: zrksyd/paracobNET
 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");
     }
 }
コード例 #3
0
ファイル: ParamValue.cs プロジェクト: zrksyd/paracobNET
        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;
            }
        }
コード例 #4
0
ファイル: Hash40Pairs.cs プロジェクト: zrksyd/paracobNET
 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.");
         }
     }
 }
コード例 #5
0
ファイル: Hash40Pairs.cs プロジェクト: zrksyd/paracobNET
 public bool ContainsKey(string keyName, IDictionary <string, ulong> labels)
 {
     return(ContainsKey(Hash40Util.LabelToHash40(keyName, labels)));
 }