public void Add(HexBitField bitField) { Debug.Assert(bitField.Owner == null); bitField.Owner = this; bitFields.Add(bitField.Bit, bitField); Debug.Assert(!DataFieldVM.HasError); // Should only be called at init and it's then always valid ulong val = ToUInt64(DataFieldVM.ObjectValue); SetValue(bitField, val); }
internal void Updated(HexBitField bitField) { ulong val = ToUInt64(ReadData()); ulong origVal = val; val &= ~(bitField.Mask << bitField.Bit); val |= bitField.GetValue() << bitField.Bit; if (origVal != val) { WriteNewValue(val); } }
void SetValue(HexBitField bitField, ulong val) { ulong bitVal = (val >> bitField.Bit) & bitField.Mask; bitField.SetValue(bitVal); }
internal void Updated(HexBitField bitField) { ulong val = ToUInt64(ReadData()); ulong origVal = val; val &= ~(bitField.Mask << bitField.Bit); val |= bitField.GetValue() << bitField.Bit; if (origVal != val) WriteNewValue(val); }