/// <summary>
 /// Initialize stream and hexeditor
 /// </summary>
 private void InitializeMStreamReplace()
 {
     ReplaceHexEdit.CloseProvider();
     _replaceMs = new MemoryStream(1);
     _replaceMs.WriteByte(0);
     ReplaceHexEdit.Stream = _replaceMs;
 }
        /// <summary>
        /// Initialize stream and hexeditor
        /// </summary>
        private void InitializeMStreamReplace(byte[] replaceData = null)
        {
            ReplaceHexEdit.CloseProvider();

            _replaceMs = new MemoryStream(1);

            if (replaceData != null && replaceData.Length > 0)
            {
                foreach (byte b in replaceData)
                {
                    _replaceMs.WriteByte(b);
                }
            }
            else
            {
                _replaceMs.WriteByte(0);
            }

            ReplaceHexEdit.Stream = _replaceMs;
        }
 private void ReplaceHexEdit_BytesDeleted(object sender, System.EventArgs e) =>
 InitializeMStream(ReplaceHexEdit, ReplaceHexEdit.GetAllBytes());
 private void ReplaceAllButton_Click(object sender, RoutedEventArgs e) =>
 _parent?.ReplaceAll(FindHexEdit.GetAllBytes(), ReplaceHexEdit.GetAllBytes(),
                     TrimMenuItem.IsChecked, HighlightMenuItem.IsChecked);