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; } }
protected StructCell AddCell(StructInstance instance, IConvertible value, int offset) { StructCell cell = new ValueCell(this, value, offset); instance.AddCell(cell, _hidden); return(cell); }
public void LoadInstanceData(StructInstance instance, Stream stream) { BinaryReader reader = new BinaryReader(stream); foreach (StructField field in _fields) { if (field.IsLinked) continue; try { 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; }
protected void AddCell(StructInstance instance, Expression expr) { instance.AddCell(new ExprCell(this, instance, expr), _hidden); }
protected void AddCell(StructInstance instance, IConvertible value, string displayValue, int offset) { instance.AddCell(new ValueCell(this, value, displayValue, offset), _hidden); }
protected StructCell AddCell(StructInstance instance, IConvertible value, int offset) { StructCell cell = new ValueCell(this, value, offset); instance.AddCell(cell, _hidden); return cell; }