Insert() 공개 메소드

public Insert ( int offset, string text ) : void
offset int
text string
리턴 void
예제 #1
0
        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));
        }
        public void Insert(int offset, string text)
        {
            if (!ReadOnly)
            {
                DocumentAboutToBeChanged?.Invoke(this, new DocumentEventArgs()
                {
                    Document = this, Offset = offset, Length = -1, Text = text
                });

                TextBuffer.Insert(offset, text);
                LineManager.Insert(offset, text);

                UndoStack.Push(new UndoableInsert(this, offset, text));

                DocumentChanged?.Invoke(this, new DocumentEventArgs()
                {
                    Document = this, Offset = offset, Length = -1, Text = text
                });
            }
        }