Пример #1
0
            /// <summary>
            /// Deletes bytes from the byte collection.
            /// </summary>
            /// <param name="index">the start index of the bytes to delete.</param>
            /// <param name="length">the length of bytes to delete.</param>
            public void DeleteBytes(long index, long length)
            {
                bytes.RemoveRange(
                    (int)Math.Max(0, index),
                    (int)Math.Min((int)Length, length));

                OnLengthChanged(EventArgs.Empty);
                OnChanged(EventArgs.Empty);
            }
Пример #2
0
 private void Replace(Int32 startIndex, ByteCollection byteCollection)
 {
     this.m_FormIFFILFWSEditor.HasChanges = true;
     byteCollection.RemoveRange(startIndex, this.GetFindBytes().Length);
     if ((this.GetReplaceBytes() != null) && (this.GetReplaceBytes().Length > 0))
     {
         byteCollection.InsertRange(startIndex, this.GetReplaceBytes());
     }
 }
Пример #3
0
        /// <summary>
        /// Deletes bytes from the byte collection.
        /// </summary>
        /// <param name="index">the start index of the bytes to delete.</param>
        /// <param name="length">the length of bytes to delete.</param>
        public void DeleteBytes(long index, long length)
        {
            int internal_index  = (int)Math.Max(0, index);
            int internal_length = (int)Math.Min((int)Length, length);

            _bytes.RemoveRange(internal_index, internal_length);

            OnLengthChanged(EventArgs.Empty);
            OnChanged(EventArgs.Empty);
        }
Пример #4
0
 private void Replace(Int32 startIndex, ByteCollection byteCollection)
 {
     this.m_FormIFFILFWSEditor.HasChanges = true;
       byteCollection.RemoveRange(startIndex, this.GetFindBytes().Length);
       if ((this.GetReplaceBytes() != null) && (this.GetReplaceBytes().Length > 0)) {
     byteCollection.InsertRange(startIndex, this.GetReplaceBytes());
       }
 }