@@ -2938,10 +2938,23 @@ private void UpdateViewers(bool controlResize)
29382938 #region Read the data from the provider and warns if necessary to load the bytes that have been deleted
29392939_provider . Position = startPosition ;
29402940var readSize = 0 ;
2941- if ( HideByteDeleted )
2941+ if ( HideByteDeleted || CanInsertAnywhere )
29422942for ( int i = 0 ; i < _viewBuffer . Length ; i ++ )
29432943{
2944- if ( ! _provider . CheckIfIsByteModified ( _provider . Position , ByteAction . Deleted ) . success )
2944+ //BYTE INSERT ANYWHERE IS IN DEVELOPMENT!! ///////////
2945+ //DOES NOT WORK CLEANLY! BE PATIENT
2946+ if ( _provider . CheckIfIsByteModified ( _provider . Position , ByteAction . Added ) . success )
2947+ {
2948+ if ( _provider . Eof ) continue ;
2949+
2950+ var ( success , val ) = _provider . CheckIfIsByteModified ( _provider . Position , ByteAction . Added ) ;
2951+
2952+ _viewBuffer [ readSize ] = val . Byte . Value ;
2953+ _viewBufferBytePosition [ readSize ] = val . BytePositionInStream ;
2954+ readSize ++ ;
2955+ }
2956+ /////////////////////////////////////////////////////
2957+ else if ( ! _provider . CheckIfIsByteModified ( _provider . Position , ByteAction . Deleted ) . success )
29452958{
29462959if ( _provider . Eof ) continue ;
29472960
@@ -2968,11 +2981,11 @@ private void UpdateViewers(bool controlResize)
29682981
29692982 #region HexByte panel refresh
29702983
2971- TraverseHexBytes ( ctrl =>
2984+ TraverseHexBytes ( c =>
29722985{
2973- ctrl . Action = ByteAction . Nothing ;
2974- ctrl . ReadOnlyMode = ReadOnlyMode ;
2975- ctrl . InternalChange = true ;
2986+ c . Action = ByteAction . Nothing ;
2987+ c . ReadOnlyMode = ReadOnlyMode ;
2988+ c . InternalChange = true ;
29762989
29772990var nextPos = startPosition + index ;
29782991
@@ -2981,24 +2994,30 @@ private void UpdateViewers(bool controlResize)
29812994while ( _provider . CheckIfIsByteModified ( nextPos , ByteAction . Deleted ) . success )
29822995nextPos ++ ;
29832996
2997+ //Insert byte
2998+ //if (CanInsertAnywhere)
2999+ //{
3000+ // var (success, val) = _provider.CheckIfIsByteModified(nextPos, ByteAction.Added);
3001+ //}
3002+
29843003if ( index < readSize && _priLevel == curLevel )
29853004{
2986- ctrl . Byte = ByteSize switch
3005+ c . Byte = ByteSize switch
29873006{
29883007ByteSizeType . Bit8 => new Byte_8bit ( _viewBuffer [ index ] ) ,
29893008ByteSizeType . Bit16 => new Byte_16bit ( new byte [ ] { _viewBuffer [ index ] , _viewBuffer [ index + 1 ] } ) ,
29903009ByteSizeType . Bit32 => new Byte_32bit ( new byte [ ] { _viewBuffer [ index ] , _viewBuffer [ index + 1 ] , _viewBuffer [ index + 2 ] , _viewBuffer [ index + 3 ] } ) ,
29913010 _=> throw new NotImplementedException ( )
29923011} ;
2993- ctrl . BytePositionInStream = ! HideByteDeleted ? nextPos : _viewBufferBytePosition [ index ] ;
3012+ c . BytePositionInStream = ! HideByteDeleted ? nextPos : _viewBufferBytePosition [ index ] ;
29943013
29953014if ( AllowVisualByteAddress && nextPos > VisualByteAdressStop )
2996- ctrl . Clear ( ) ;
3015+ c . Clear ( ) ;
29973016}
29983017else
2999- ctrl . Clear ( ) ;
3018+ c . Clear ( ) ;
30003019
3001- ctrl . InternalChange = false ;
3020+ c . InternalChange = false ;
30023021index += ByteSizeRatio ;
30033022} ) ;
30043023
@@ -3009,13 +3028,13 @@ private void UpdateViewers(bool controlResize)
30093028 #region StringByte / Barchart panel refresh
30103029
30113030var skipNextIsMTE = false ;
3012- TraverseStringBytes ( ctrl =>
3031+ TraverseStringBytes ( c =>
30133032{
3014- ctrl . Action = ByteAction . Nothing ;
3015- ctrl . ReadOnlyMode = ReadOnlyMode ;
3016- ctrl . InternalChange = true ;
3017- ctrl . TblCharacterTable = _tblCharacterTable ;
3018- ctrl . TypeOfCharacterTable = TypeOfCharacterTable ;
3033+ c . Action = ByteAction . Nothing ;
3034+ c . ReadOnlyMode = ReadOnlyMode ;
3035+ c . InternalChange = true ;
3036+ c . TblCharacterTable = _tblCharacterTable ;
3037+ c . TypeOfCharacterTable = TypeOfCharacterTable ;
30193038
30203039var nextPos = startPosition + index ;
30213040
@@ -3028,37 +3047,37 @@ private void UpdateViewers(bool controlResize)
30283047{
30293048if ( ! skipNextIsMTE )
30303049{
3031- ctrl . BytePositionInStream = ! HideByteDeleted ? nextPos : _viewBufferBytePosition [ index ] ;
3050+ c . BytePositionInStream = ! HideByteDeleted ? nextPos : _viewBufferBytePosition [ index ] ;
30323051
30333052 #region Load ByteNext for TBL MTE matching
30343053if ( _tblCharacterTable is notnull )
30353054{
3036- var ( singleByte , succes ) = _provider . GetByte ( ctrl . BytePositionInStream + 1 ) ;
3037- ctrl . ByteNext = succes ? singleByte : null ;
3055+ var ( singleByte , succes ) = _provider . GetByte ( c . BytePositionInStream + 1 ) ;
3056+ c . ByteNext = succes ? singleByte : null ;
30383057}
30393058 #endregion
30403059
30413060//update byte
3042- ctrl . Byte = new Byte_8bit ( _viewBuffer [ index ] ) ;
3061+ c . Byte = new Byte_8bit ( _viewBuffer [ index ] ) ;
30433062
30443063//Bar chart value
3045- ctrl . PercentValue = _viewBuffer [ index ] * 100 / 256 ;
3064+ c . PercentValue = _viewBuffer [ index ] * 100 / 256 ;
30463065
3047- skipNextIsMTE = ctrl . IsMTE ;
3066+ skipNextIsMTE = c . IsMTE ;
30483067
30493068if ( AllowVisualByteAddress && nextPos > VisualByteAdressStop )
3050- ctrl . Clear ( ) ;
3069+ c . Clear ( ) ;
30513070}
30523071else
30533072{
30543073skipNextIsMTE = false ;
3055- ctrl . Clear ( ) ;
3074+ c . Clear ( ) ;
30563075}
30573076}
30583077else
3059- ctrl . Clear ( ) ;
3078+ c . Clear ( ) ;
30603079
3061- ctrl . InternalChange = false ;
3080+ c . InternalChange = false ;
30623081index ++ ;
30633082} ) ;
30643083