@@ -1023,6 +1023,8 @@ private void Provider_ReadOnlyChanged(object sender, EventArgs e)
10231023if ( ! CheckIsOpen ( _provider ) ) return ;
10241024
10251025ReadOnlyMode = _provider . IsLockedFile || _provider . ReadOnlyMode ;
1026+
1027+ ReadOnlyChanged ? . Invoke ( sender , e ) ;
10261028}
10271029
10281030 #endregion ReadOnly property/event
@@ -2904,7 +2906,7 @@ private void UpdateViewers(bool controlResize)
29042906{
29052907var bufferlength = MaxVisibleLine * ( BytePerLine + 1 + ByteShiftLeft ) * ByteSizeRatio ;
29062908
2907- #region Build the bufferlenght if needed
2909+ #region Build the bufferlength if needed
29082910
29092911if ( controlResize )
29102912{
@@ -3835,7 +3837,7 @@ public IEnumerable<long> ReplaceAll(string find, string replace, bool truckLengt
38353837/// <summary>
38363838/// Update statusbar for somes property dont support dependency property
38373839/// </summary>
3838- private void UpdateStatusBar ( bool updateFileLenght = true )
3840+ private void UpdateStatusBar ( bool updateFilelength = true )
38393841{
38403842if ( StatusBarVisibility != Visibility . Visible ) return ;
38413843
@@ -3847,7 +3849,7 @@ private void UpdateStatusBar(bool updateFileLenght = true)
38473849}
38483850
38493851 #region Show length
3850- if ( updateFileLenght )
3852+ if ( updateFilelength )
38513853{
38523854var isMegabByte = false ;
38533855
@@ -5417,17 +5419,17 @@ private static void Control_DeletePropertyChanged(DependencyObject d,
54175419}
54185420
54195421/// <summary>
5420- /// Select bytes setted by bytePositionInStream with thelenght
5422+ /// Select bytes setted by bytePositionInStream with thelength
54215423/// </summary>
54225424/// <param name="bytePositionInStream">First byte to delete</param>
5423- /// <param name="lenght ">Number of byte to delete</param>
5424- public void DeleteBytesAtPosition ( long bytePositionInStream , long lenght = 1 )
5425+ /// <param name="length ">Number of byte to delete</param>
5426+ public void DeleteBytesAtPosition ( long bytePositionInStream , long length = 1 )
54255427{
54265428var previousSelectionStart = SelectionStart ;
54275429var previousSelectionStop = SelectionStop ;
54285430
54295431SelectionStart = bytePositionInStream ;
5430- SelectionStop = bytePositionInStream + lenght ;
5432+ SelectionStop = bytePositionInStream + length ;
54315433
54325434DeleteSelection ( ) ;
54335435
@@ -5667,15 +5669,37 @@ private static void Control_CanInsertEverywhereChanged(DependencyObject d, Depen
56675669/// <summary>
56685670/// Insert byte at the specified position
56695671/// </summary>
5670- public void InsertByte ( byte @byte , long bytePositionInStream )
5672+ public void InsertByte ( byte @byte , long bytePositionInStream ) =>
5673+ InsertByte ( @byte , bytePositionInStream , 1 ) ;
5674+
5675+ /// <summary>
5676+ /// Insert byte at the specified position for the length
5677+ /// </summary>
5678+ public void InsertByte ( byte @byte , long bytePositionInStream , long length )
56715679{
56725680if ( ! CheckIsOpen ( _provider ) ) return ;
56735681if ( ! CanInsertEverywhere ) return ;
56745682
5675- _provider . AddByteAdded ( @byte , bytePositionInStream ) ;
5683+ for ( int i = 0 ; i <= length ; i ++ )
5684+ _provider . AddByteAdded ( @byte , bytePositionInStream + i ) ;
56765685
56775686RefreshView ( ) ;
56785687}
5688+
5689+ /// <summary>
5690+ /// Insert an array of byte at specified position
5691+ /// </summary>
5692+ public void InsertBytes ( byte [ ] bytes , long bytePositionInStream )
5693+ {
5694+ if ( ! CheckIsOpen ( _provider ) ) return ;
5695+ if ( ! CanInsertEverywhere ) return ;
5696+
5697+ foreach ( byte @byte in bytes )
5698+ _provider . AddByteAdded ( @byte , bytePositionInStream ++ ) ;
5699+
5700+ RefreshView ( ) ;
5701+ }
5702+
56795703 #endregion
56805704}
56815705}