/// <summary> /// Constructor /// </summary> /// <param name="file">File</param> /// <param name="structure">Structure</param> public FileAndStructure(HexBufferFile file, ComplexData structure) { if (file == null) { throw new ArgumentNullException(nameof(file)); } if (structure == null) { throw new ArgumentNullException(nameof(structure)); } File = file; Structure = structure; }
/// <summary> /// Returns the span the field value references or null. The span can be empty. /// </summary> /// <param name="file">File</param> /// <param name="structure">Structure</param> /// <param name="position">Position</param> /// <returns></returns> public virtual HexSpan?GetFieldReferenceSpan(HexBufferFile file, ComplexData structure, HexPosition position) => null;
/// <summary> /// Returns a reference or null /// </summary> /// <param name="file">File</param> /// <param name="structure">Structure</param> /// <param name="position">Position</param> /// <returns></returns> public virtual object?GetReference(HexBufferFile file, ComplexData structure, HexPosition position) => null;
/// <summary> /// Gets indexes of sub structures or null. The returned array must be sorted. If the array /// is empty, every field is a sub structure. /// </summary> /// <param name="file">File</param> /// <param name="structure">Structure</param> /// <param name="position">Position</param> /// <returns></returns> public virtual HexIndexes[]? GetSubStructureIndexes(HexBufferFile file, ComplexData structure, HexPosition position) => null;
/// <summary> /// Constructor /// </summary> /// <param name="file">File</param> /// <param name="structure">Structure</param> public FileAndStructure(HexBufferFile file, ComplexData structure) { File = file ?? throw new ArgumentNullException(nameof(file)); Structure = structure ?? throw new ArgumentNullException(nameof(structure)); }
/// <summary> /// Returns a tooltip or null /// </summary> /// <param name="file">File</param> /// <param name="structure">Structure</param> /// <param name="position">Position</param> /// <returns></returns> public virtual object GetToolTip(HexBufferFile file, ComplexData structure, HexPosition position) => null;
/// <summary> /// Writes the field and value /// </summary> /// <param name="structure">Owner structure</param> /// <param name="position">Position of field within <paramref name="structure"/></param> public virtual void WriteFieldAndValue(ComplexData structure, HexPosition position) { WriteField(structure, position); WriteEquals(); WriteValue(structure, position); }
/// <summary> /// Writes the field value /// </summary> /// <param name="structure">Owner structure</param> /// <param name="position">Position of field within <paramref name="structure"/></param> public abstract void WriteValue(ComplexData structure, HexPosition position);