Exemplo n.º 1
0
        public IDeleteLineCommand <OperationContext> CreateDeleteLineCommand(
            LinePosition line)
        {
            var operation = new DeleteLinesOperation((int)line, 1);

            return(operation);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Performs the delete lines operation on the buffer.
        /// </summary>
        /// <param name="operation">The operation to perform.</param>
        /// <returns>
        /// The results to the changes to the buffer.
        /// </returns>
        protected override LineBufferOperationResults Do(
            DeleteLinesOperation operation)
        {
            // Shift the styles down for the deleted lines.
            for (int lineIndex = 0;
                 lineIndex < LineCount;
                 lineIndex++)
            {
                // If we have a key, shift it.
                if (lineIndex >= operation.Line &&
                    styles.ContainsKey(lineIndex))
                {
                    styles[lineIndex - operation.Count] = styles[lineIndex];
                    styles.Remove(lineIndex);
                }
            }

            // Now, perform the operation on the buffer.
            return(base.Do(operation));
        }
        protected override LineBufferOperationResults Do(
            DeleteLinesOperation operation)
        {
            //// We only need a read-lock on the blocks just to make sure nothing moves
            //// underneath us while we get the block key.
            //using (blocks.AcquireLock(RequestLock.Read))
            //{
            //	// Add each delete line into a composite command.
            //	var deleteCommand = new CompositeCommand();

            //	for (int lineIndex = operation.LineIndex;
            //		lineIndex < operation.LineIndex + operation.Count;
            //		lineIndex++)
            //	{
            //		Block block = blocks[lineIndex];
            //		var command = new DeleteBlockCommand(block.BlockKey);
            //		deleteCommand.Commands.Add(command);
            //	}

            //	// Submit the delete line.
            //	commands.Do(deleteCommand);

            //	// Raise the deleted line events.
            //	RaiseLinesDeleted(
            //		new LineRangeEventArgs(
            //			operation.LineIndex, operation.LineIndex + operation.Count));

            //	// Construct the operation results for the delete from information in the
            //	// command manager.
            //	var results =
            //		new LineBufferOperationResults(
            //			new TextPosition(operation.LineIndex, commands.LastPosition.TextIndex));
            //	return results;
            //}
            throw new NotImplementedException();
        }
        protected override LineBufferOperationResults Do(
			DeleteLinesOperation operation)
        {
            //// We only need a read-lock on the blocks just to make sure nothing moves
            //// underneath us while we get the block key.
            //using (blocks.AcquireLock(RequestLock.Read))
            //{
            //	// Add each delete line into a composite command.
            //	var deleteCommand = new CompositeCommand();

            //	for (int lineIndex = operation.LineIndex;
            //		lineIndex < operation.LineIndex + operation.Count;
            //		lineIndex++)
            //	{
            //		Block block = blocks[lineIndex];
            //		var command = new DeleteBlockCommand(block.BlockKey);
            //		deleteCommand.Commands.Add(command);
            //	}

            //	// Submit the delete line.
            //	commands.Do(deleteCommand);

            //	// Raise the deleted line events.
            //	RaiseLinesDeleted(
            //		new LineRangeEventArgs(
            //			operation.LineIndex, operation.LineIndex + operation.Count));

            //	// Construct the operation results for the delete from information in the
            //	// command manager.
            //	var results =
            //		new LineBufferOperationResults(
            //			new TextPosition(operation.LineIndex, commands.LastPosition.TextIndex));
            //	return results;
            //}
            throw new NotImplementedException();
        }
 /// <summary>
 /// Performs the delete lines operation on the buffer.
 /// </summary>
 /// <param name="operation">The operation to perform.</param>
 /// <returns>
 /// The results to the changes to the buffer.
 /// </returns>
 protected override LineBufferOperationResults Do(
     DeleteLinesOperation operation)
 {
     throw new NotImplementedException();
 }