public HexBoxWriteEventArgs(HexWriteType type, ulong offs, int size, bool isBeforeWrite, Dictionary<object, object> context = null) { this.Type = type; this.StartOffset = offs; this.EndOffset = size == 0 ? offs : NumberUtils.AddUInt64(offs, (ulong)(size - 1)); this.Size = size; this.IsBeforeWrite = isBeforeWrite; this.Context = context ?? new Dictionary<object, object>(); }
public HexBoxWriteEventArgs(HexWriteType type, ulong offs, int size, bool isBeforeWrite, Dictionary <object, object> context = null) { this.Type = type; this.StartOffset = offs; this.EndOffset = size == 0 ? offs : NumberUtils.AddUInt64(offs, (ulong)(size - 1)); this.Size = size; this.IsBeforeWrite = isBeforeWrite; this.Context = context ?? new Dictionary <object, object>(); }
bool TryUpdateOldTextInputCommand(HexWriteType type, HexBox hexBox, HexBoxPosition posBeforeWrite, ulong startOffset, byte[] originalData) { if (type != HexWriteType.ByteInput && type != HexWriteType.AsciiInput) return false; var cmd = (HexBoxUndoCommand)prevTextInputCmd.Target; if (cmd == null) return false; return cmd.TryAppend(hexBox, posBeforeWrite, startOffset, originalData); }
bool TryUpdateOldTextInputCommand(HexWriteType type, HexBox hexBox, HexBoxPosition posBeforeWrite, ulong startOffset, byte[] originalData) { if (type != HexWriteType.ByteInput && type != HexWriteType.AsciiInput) { return(false); } var cmd = (HexBoxUndoCommand)prevTextInputCmd.Target; if (cmd == null) { return(false); } return(cmd.TryAppend(hexBox, posBeforeWrite, startOffset, originalData)); }
Dictionary<object, object> NotifyWrite(HexWriteType type, ulong offs, int count, bool isBeforeWrite, Dictionary<object, object> context) { var ea = new HexBoxWriteEventArgs(type, offs, count, isBeforeWrite, context); if (OnWrite != null) OnWrite(this, ea); return ea.Context; }
Dictionary<object, object> NotifyBeforeWrite(HexWriteType type, ulong offs, int count) { return NotifyWrite(type, offs, count, true, null); }
void NotifyAfterWrite(HexWriteType type, ulong offs, int count, Dictionary<object, object> context) { NotifyWrite(type, offs, count, false, context); }