Exemplo n.º 1
0
        ///<summary>Insert bytes into the buffer</summary>
        public override void Insert(long pos, byte[] data, long index, long length)
        {
            lock (LockObj) {
                if (!modifyAllowed)
                {
                    return;
                }
                if (!IsResizable)
                {
                    return;
                }

                if (pos == size)
                {
                    Append(data, index, length);
                    return;
                }

                InsertAction ia = new InsertAction(pos, data, index, length, this);
                ia.Do();

                // if action isn't handled as chained (ActionChaining == false)
                // handle it manually
                if (!HandleChaining(ia))
                {
                    AddUndoAction(ia);
                    RedoDequeDispose();
                }

                EmitChanged();
            }
        }
Exemplo n.º 2
0
 public ReplaceAction(long p1, long p2, byte[] d, long index, long length, ByteBuffer bb)
 {
     del = new DeleteAction(p1, p2, bb);
     ins = new InsertAction(p1, d, index, length, bb);
 }