static void Main(string[] args) { BaseAccount a = new BaseAccount(); a.Balance = 100; Console.WriteLine(a.Balance.ToString()); a.addDeposit(500); Console.WriteLine(a.Balance.ToString()); AccountDecorator AccountDec = new AccountDecorator(a); AccountValidationDecorator V = new AccountValidationDecorator(a); if (V.drawAllowed(100)) { V.Draw(100); Console.WriteLine(string.Format("Draw allowed. Final Balance: {0}", V.Balance)); } else { Console.WriteLine("Insufficient Funds"); } }
public void addDeposit(double amount) { m_BaseAccount.addDeposit(amount); }