Ejemplo n.º 1
0
        public IInsertLineCommand <OperationContext> CreateInsertLineCommand(
            LinePosition line)
        {
            var operation = new InsertLinesOperation((int)line, 1);

            return(operation);
        }
        protected override LineBufferOperationResults Do(
            InsertLinesOperation operation)
        {
            //// We need a write lock on the blocks since this will be making changes
            //// to the structure of the document.
            //using (blocks.AcquireLock(RequestLock.Write))
            //{
            //	// Create the command and submit it to the project's command manager.
            //	Block block = blocks[operation.LineIndex];
            //	var command = new InsertAfterBlockCommand(block.BlockKey, operation.Count);
            //	commands.Do(command);

            //	// Raise the events to indicate the line changed.
            //	RaiseLinesInserted(
            //		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(blocks.IndexOf(block), commands.LastPosition.TextIndex));
            //	return results;
            //}
            throw new NotImplementedException();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Performs the insert 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(
            InsertLinesOperation operation)
        {
            // First shift the style lines up for the new ones. We go from the
            // bottom to avoid overlapping the line numbers.
            for (int lineIndex = LineCount - 1;
                 lineIndex >= 0;
                 lineIndex--)
            {
                // If we have a key, shift it.
                if (lineIndex >= operation.LineIndex &&
                    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(
			InsertLinesOperation operation)
        {
            //// We need a write lock on the blocks since this will be making changes
            //// to the structure of the document.
            //using (blocks.AcquireLock(RequestLock.Write))
            //{
            //	// Create the command and submit it to the project's command manager.
            //	Block block = blocks[operation.LineIndex];
            //	var command = new InsertAfterBlockCommand(block.BlockKey, operation.Count);
            //	commands.Do(command);

            //	// Raise the events to indicate the line changed.
            //	RaiseLinesInserted(
            //		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(blocks.IndexOf(block), commands.LastPosition.TextIndex));
            //	return results;
            //}
            throw new NotImplementedException();
        }
 /// <summary>
 /// Performs the insert 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(
     InsertLinesOperation operation)
 {
     throw new NotImplementedException();
 }