示例#1
0
        public int GetCustomValue(IntMinimumFieldKey key)
        {
            if (key.Index < 0)
            {
                return(key.Offset);
            }
            ArrayChecker(ref _customBits, key.Index);
            long storedValue    = GetInteger(_customBits[key.Index], key.Position, key.Mask);
            long correctedValue = storedValue + key.Offset;

            return((int)correctedValue);
        }
示例#2
0
        public void SetCustomValue(IntMinimumFieldKey key, int value)
        {
            if (key.Index < 0)
            {
                return;
            }
            if (key.Offset > value)
            {
                throw new Exception("The value can not be lower than the specified minimum value. ");
            }
            ArrayChecker(ref _customBits, key.Index);
            long givenValue     = value;
            long correctedValue = givenValue - key.Offset;

            SetInteger(ref _customBits[key.Index], key.Position, key.Mask, (uint)correctedValue);
        }
示例#3
0
文件: Block.cs 项目: renezaal/dfLike
 public void SetCustomValue(IntMinimumFieldKey key, int value)
 {
     if (key.Index < 0) { return; }
     if (key.Offset > value) { throw new Exception("The value can not be lower than the specified minimum value. "); }
     ArrayChecker(ref _customBits, key.Index);
     long givenValue = value;
     long correctedValue = givenValue - key.Offset;
     SetInteger(ref _customBits[key.Index], key.Position, key.Mask, (uint)correctedValue);
 }
示例#4
0
文件: Block.cs 项目: renezaal/dfLike
 public int GetCustomValue(IntMinimumFieldKey key)
 {
     if (key.Index < 0)
     {
         return key.Offset;
     }
     ArrayChecker(ref _customBits, key.Index);
     long storedValue = GetInteger(_customBits[key.Index], key.Position, key.Mask);
     long correctedValue = storedValue + key.Offset;
     return (int)correctedValue;
 }