Exemplo n.º 1
0
        public override void Execute(TextCompletionEngine textCompletionEngine, TextArea textArea)
        {
            textArea.GetSelectionBounds(out int startLine, out int endLine);
            int startOffset = textArea.Document.GetOffset(startLine, 0);

            textArea.Document.UndoStack.StartUndoGroup();
            try
            {
                for (int i = startLine; i <= endLine; i++)
                {
                    ICSharpCode.AvalonEdit.Document.DocumentLine line = textArea.Document.GetLineByNumber(i);
                    string lineText = textArea.Document.GetText(line.Offset, line.Length);
                    if (lineText.StartsWith(Prefix))
                    {
                        textArea.Document.Remove(line.Offset, Prefix.Length);
                    }
                }

                ICSharpCode.AvalonEdit.Document.DocumentLine endDocumentLine = textArea.Document.GetLineByNumber(endLine);
                textArea.Selection = Selection.Create(textArea, startOffset, endDocumentLine.EndOffset);
            }
            finally
            {
                textArea.Document.UndoStack.EndUndoGroup();
            }
        }
Exemplo n.º 2
0
 public virtual void Execute(TextCompletionEngine textCompletionEngine, TextArea textArea)
 {
 }
Exemplo n.º 3
0
 public void ExecuteCommand(TextArea textArea, TextCompletionEngine textCompletionEngine)
 {
     Command.Execute(textCompletionEngine, textArea);
 }
Exemplo n.º 4
0
 public override void Execute(TextCompletionEngine textCompletionEngine, TextArea textArea)
 {
     textCompletionEngine.CompleteCode();
 }