Beispiel #1
0
        public void LoadInstanceData(StructInstance instance, Stream stream)
        {
            BinaryReader reader = new BinaryReader(stream);

            foreach (StructField field in _fields)
            {
                if (field.IsLinked)
                {
                    continue;
                }

                try
                {
                    field.Offset = reader.BaseStream.Position;
                    field.LoadData(reader, instance);
                }
                catch (LoadDataException ex)
                {
                    instance.AddCell(ValueCell.CreateErrorCell(field, ex.Message), false);
                    break;
                }
                catch (IOException ex)
                {
                    instance.AddCell(ValueCell.CreateErrorCell(field, ex.Message), false);
                    break;
                }
            }
            long offset = instance.GetLastRewindOffset();

            if (offset != -1)
            {
                stream.Position = offset;
            }
        }
Beispiel #2
0
        protected StructCell AddCell(StructInstance instance, IConvertible value, int offset)
        {
            StructCell cell = new ValueCell(this, value, offset);

            instance.AddCell(cell, _hidden);
            return(cell);
        }
Beispiel #3
0
 protected StructCell AddCell(StructInstance instance, IConvertible value, int offset)
 {
     StructCell cell = new ValueCell(this, value, offset);
     instance.AddCell(cell, _hidden);
     return cell;
 }
Beispiel #4
0
        protected void AddCell(StructInstance instance, IConvertible value, string displayValue, int offset)
        {
            StructCell cell = new ValueCell(this, value, displayValue, offset);

            instance.AddCell(cell, _hidden);
        }