Пример #1
0
        /// <summary>
        /// Inserts a string of characters into the sequence.
        /// </summary>
        /// <param name="offset">Offset where to insert the string.</param>
        /// <param name="text">Text to be inserted.</param>
        public void Insert(int offset, string text)
        {
            if (_readOnly)
            {
                return;
            }

            OnDocumentAboutToBeChanged(new DocumentEventArgs(this, offset, -1, text));
            _textBufferStrategy.Insert(offset, text);
            _lineTrackingStrategy.Insert(offset, text);
            _undoStack.Push(new UndoableInsert(this, offset, text));
            OnDocumentChanged(new DocumentEventArgs(this, offset, -1, text));
        }