public static void Main()
Account account = new Account(200);
account.Added += Show_Message;
account.Withdrawn += Show_Message;
account.Withdrawn -= Show_Message;
private static void Show_Message(string message)
Console.WriteLine(message);
public delegate void AccountStateHandler(string message);
public event AccountStateHandler Withdrawn;
public event AccountStateHandler Added;
Console.WriteLine(String.Format("На счет поступило {0}",sum));
public void Withdraw(int sum)
Console.WriteLine(String.Format("Сумма {0} снята со счета",sum));
Console.WriteLine(String.Format("Недостаточно денег на счете",sum));