示例#1
0
        public override IMemento <List <Transaction> > Restore(ref List <Transaction> target)
        {
            Transaction removed = target[index];
            IMemento <List <Transaction> > inverse = new RemoveTransactionMemento(index, removed);

            target.RemoveAt(index);
            return(inverse);
        }
示例#2
0
        public override IMemento <List <Transaction> > Restore(ref List <Transaction> target)
        {
            int index = target.Count - 1;
            IMemento <List <Transaction> > inverse = new RemoveTransactionMemento(index, target[index]);

            target.RemoveAt(target.Count - 1);
            return(inverse);
        }