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;
String.Format("На счет поступило {sum}",Added);
public void Withdraw(int sum)
String.Format("Сумма {sum} снята со счета",Withdrawn);
String.Format("Недостаточно денег на счете",Withdrawn);