System.Windows.Forms.ByteCollection.RemoveRange C# (CSharp) Method

RemoveRange() public method

Removes a range of bytes from the collection.
public RemoveRange ( int index, int count ) : void
index int the index of the start byte
count int the count of the bytes to remove
return void
        public void RemoveRange(int index, int count)
        {
            InnerList.RemoveRange(index, count);
        }

Usage Example

Example #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)
        {
            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);
        }