Open kb-1000 opened 1 week ago
Inserting also seems to behave quite weirdly in general - so currently more or less everything but viewing and editing existing bytes appears to be broken. Unfortunately there's also no builtin resizable IBinaryDocument
, though currently there wouldn't be much of a point anyways. I created my own using a List<byte>
, could PR it if this gets fixed.
This screenshot shows some (but not all) of the weirdness, created by repeatedly typing A in varying locations:
It only really lets you edit one of the two half-bytes in insert mode. It also doesn't let you place the caret behind the last half-byte, so you can't append bytes.
```cs
public class DynamicBinaryDocument : IBinaryDocument
{
private readonly List
This is correct. Currently the control only fully supports viewing and editing existing bytes. This is also one of the reasons there is no dynamically resizable binary document implementation yet. The interface methods are currently there as a WIP / future work.
Ideally, for a dynamically resizable document we should not use List<byte>
, as this would result in insert and remove becoming O(n) operations, which is really bad for large documents of several 100s of megabytes to gigabytes.
CanRemove and RemoveBytes exist, but appear to be unused.