Esempio n. 1
0
 public void SimulateTypeText(DeveroomEditorTypeCharCommandBase command, string text)
 {
     foreach (var ch in text)
     {
         SimulateType(command, ch);
     }
 }
        public void SimulateType(DeveroomEditorTypeCharCommandBase command, char c)
        {
            var caretPosition = Caret.Position.BufferPosition.Position;

            using (var textEdit = TextBuffer.CreateEdit())
            {
                textEdit.Insert(Caret.Position.BufferPosition.Position, c.ToString());
                textEdit.Apply();
            }
            Caret.MoveTo(new SnapshotPoint(TextSnapshot, caretPosition + 1));
            ForceReparse(); //this is needed because currently partial table formatting is not supported

            command.PostExec(this, c);
        }