protected override LineBufferOperationResults Do( InsertTextOperation operation) { //// We need a write lock on the block and a read lock on the blocks. //Block block = blocks[operation.TextPosition.LineIndex]; //using (block.AcquireBlockLock(RequestLock.Write)) //{ // // Create the command and submit it to the project's command manager. // var command = // new InsertTextCommand( // new BlockPosition(block.BlockKey, operation.TextPosition.CharacterIndex), // operation.Text); // commands.Do(command); // // Fire a line changed operation. // RaiseLineChanged(new LineChangedArgs(operation.TextPosition.LineIndex)); // // 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> /// Inserts the text using a <see cref="InsertTextOperation"/>. /// </summary> /// <param name="bufferPosition">The buffer position.</param> /// <param name="text">The text.</param> public LineBufferOperationResults InsertText( TextPosition bufferPosition, string text) { var operation = new InsertTextOperation(bufferPosition, text); return(Do(operation)); }
/// <summary> /// Performs the given operation on the line buffer. This will raise any /// events that were appropriate for the operation. /// </summary> /// <param name="operation">The operation to perform.</param> /// <returns> /// The results to the changes to the buffer. /// </returns> protected override LineBufferOperationResults Do( InsertTextOperation operation) { LineBufferOperationResults results = base.Do(operation); return(CheckForStyleChanged( (int)operation.TextPosition.LinePosition, results)); }
public IInsertTextCommand <OperationContext> CreateInsertTextCommand( TextPosition textPosition, string text) { var operation = new InsertTextOperation( textPosition.LinePosition, textPosition.CharacterPosition, text); return(operation); }
protected override LineBufferOperationResults Do( InsertTextOperation operation) { //// We need a write lock on the block and a read lock on the blocks. //Block block = blocks[operation.TextPosition.LineIndex]; //using (block.AcquireBlockLock(RequestLock.Write)) //{ // // Create the command and submit it to the project's command manager. // var command = // new InsertTextCommand( // new BlockPosition(block.BlockKey, operation.TextPosition.CharacterIndex), // operation.Text); // commands.Do(command); // // Fire a line changed operation. // RaiseLineChanged(new LineChangedArgs(operation.TextPosition.LineIndex)); // // 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 given operation on the line buffer. This will raise any /// events that were appropriate for the operation. /// </summary> /// <param name="operation">The operation to perform.</param> /// <returns> /// The results to the changes to the buffer. /// </returns> protected override LineBufferOperationResults Do( InsertTextOperation operation) { throw new NotImplementedException(); }