private void Logout(object sender, EventArgs e) { messenger.ReceivedRequest -= OnReceivedRequest; messenger.ReceivedMessage -= OnReceivedMessage; broker.UpdateOnlineUsers -= brokerIntermediate.FireUpdateOnlineUsers; broker.Logout(self.Nick); Application.Exit(); }