using System; namespace Be.Windows.Forms { /// /// Defines a byte provider for HexBox control /// public interface IByteProvider { /// /// Reads a byte from the provider /// /// the index of the byte to read /// the byte to read byte ReadByte(long index); /// /// Writes a byte into the provider /// /// the index of the byte to write /// the byte to write void WriteByte(long index, byte value); /// /// Inserts bytes into the provider /// /// /// /// This method must raise the LengthChanged event. void InsertBytes(long index, byte[] bs); /// /// Deletes bytes from the provider /// /// the start index of the bytes to delete /// the length of the bytes to delete /// This method must raise the LengthChanged event. void DeleteBytes(long index, long length); /// /// Returns the total length of bytes the byte provider is providing. /// long Length { get; } /// /// Occurs, when the Length property changed. /// event EventHandler LengthChanged; /// /// True, when changes are done. /// bool HasChanges(); /// /// Applies changes. /// void ApplyChanges(); /// /// Occurs, when bytes are changed. /// event EventHandler Changed; /// /// Returns a value if the WriteByte methods is supported by the provider. /// /// True, when itīs supported. bool SupportsWriteByte(); /// /// Returns a value if the InsertBytes methods is supported by the provider. /// /// True, when itīs supported. bool SupportsInsertBytes(); /// /// Returns a value if the DeleteBytes methods is supported by the provider. /// /// True, when itīs supported. bool SupportsDeleteBytes(); } }