예제 #1
0
		private void ExecuteInTransation(Action transaction)
		{
			var memento = new UserMemento(this);
			try
			{
				transaction();
			}
			catch (Exception)
			{
				Restore(memento);
				throw;
			}
		}
예제 #2
0
		private void Restore(UserMemento memento)
		{
			Coins = new CoinStock(memento.Coins);
		}