private void ClientConnect(ConnectEventArgs args) { if (args.Error == null) ClientModel.Api.Register(); else { SelectedRoom.AddSystemMessage(args.Error.Message); if (ClientModel.IsInited) ClientModel.Reset(); } }
private void ClientConnect(object sender, ConnectEventArgs e) { Dispatcher.BeginInvoke(new Action<ConnectEventArgs>(args => { if (args.Error != null) { SelectedRoom.AddSystemMessage(args.Error.Message); if (ClientModel.IsInited) ClientModel.Reset(); return; } if (ClientModel.Api != null) ClientModel.Api.Register(); }), e); }