Beispiel #1
0
 public bool this[int index]
 {
     get { return(((uint)_data >> index & 1) != 0); }
     set
     {
         if (value)
         {
             _data = (BUInt24)((uint)_data | (uint)(1 << index));
         }
         else
         {
             _data = (BUInt24)((uint)_data & ~(uint)(1 << index));
         }
     }
 }
Beispiel #2
0
        //public uint this[int shift, int mask]
        //{
        //    get { return (uint)(data >> shift & mask); }
        //    set { data = (uint)((data & ~(mask << shift)) | ((value & mask) << shift)); }
        //}

        public int this[int shift, int bitCount]
        {
            get
            {
                int mask = 0;
                for (int i = 0; i < bitCount; i++)
                {
                    mask |= 1 << i;
                }
                return((int)(((uint)_data >> shift) & mask));
            }
            set
            {
                int mask = 0;
                for (int i = 0; i < bitCount; i++)
                {
                    mask |= 1 << i;
                }
                _data = (BUInt24)(uint)(((uint)_data & ~(mask << shift)) | (((uint)value & mask) << shift));
            }
        }
Beispiel #3
0
 public Bin24(BUInt24 val)
 {
     _data = val;
 }
 //public uint this[int shift, int mask]
 //{
 //    get { return (uint)(data >> shift & mask); }
 //    set { data = (uint)((data & ~(mask << shift)) | ((value & mask) << shift)); }
 //}
 public int this[int shift, int bitCount]
 {
     get
     {
         int mask = 0;
         for (int i = 0; i < bitCount; i++)
             mask |= 1 << i;
         return (int)(((uint)_data >> shift) & mask);
     }
     set
     {
         int mask = 0;
         for (int i = 0; i < bitCount; i++)
             mask |= 1 << i;
         _data = (BUInt24)(uint)(((uint)_data & ~(mask << shift)) | (((uint)value & mask) << shift));
     }
 }
 public bool this[int index]
 {
     get { return ((uint)_data >> index & 1) != 0; }
     set
     {
         if (value)
             _data = (BUInt24)((uint)_data | (uint)(1 << index));
         else
             _data = (BUInt24)((uint)_data & ~(uint)(1 << index));
     }
 }
 public Bin24(BUInt24 val)
 {
     _data = val;
 }