Exemple #1
0
        static decimal ReadDecimal(HexBuffer buffer, HexPosition position)
        {
            var bits = new int[4] {
                buffer.ReadInt32(position),                             // lo
                buffer.ReadInt32(position + 4),                         // mid
                buffer.ReadInt32(position + 8),                         // hi
                buffer.ReadInt32(position + 0x0C),                      // flags
            };

            try {
                return(new decimal(bits));
            }
            catch (ArgumentException) {
            }
            return(decimal.Zero);
        }
Exemple #2
0
 public Int32HexField(HexBuffer buffer, string parentName, string name, HexPosition start, bool useDecimal = false)
     : base(buffer, parentName, name, start, 4)
 {
     data = new Int32VM(buffer.ReadInt32(start), a => UpdateValue(), useDecimal);
 }