Exemplo n.º 1
0
        public void Undo(ITextBuffer target)
        {
            if (!done)
                throw new InvalidOperationException("Command is already unapplied.");

            target.SetCarets(after);
            target.ReplaceText(textBefore, false);
            target.SetCarets(before);
            done = false;
        }
Exemplo n.º 2
0
        public void Undo(ITextBuffer target)
        {
            if (!done)
                throw new InvalidOperationException("not done");

            for (int i = inner.Count - 1; i >= 0; i--)
                inner[i].Undo(target);

            target.SetCarets(before);
            done = false;
        }
Exemplo n.º 3
0
        public void Do(ITextBuffer target)
        {
            if (done)
                throw new InvalidOperationException("already done");

            foreach (ICommand r in inner)
                r.Do(target);

            target.SetCarets(after);
            done = true;
        }
Exemplo n.º 4
0
        public void Do(ITextBuffer target)
        {
            if (done)
                throw new InvalidOperationException("Command is already applied.");

            target.SetCarets(before);
            target.ReplaceText(textAfter, autoIndent);
            after = target.GetCarets();
            target.Mark = target.Point;
            done = true;
        }