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); }
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); }