public async void connected(Glacier2.SessionHelper session) { // // Ignore callbacks during shutdown. // if (_exit) { return; } // // If the session has been reassigned avoid the spurious callback. // if (session != _session) { return; } Chat.ChatRoomCallbackPrx callback = Chat.ChatRoomCallbackPrxHelper.uncheckedCast( _session.addWithUUID(new ChatRoomCallbackI(this))); _chat = Chat.ChatSessionPrxHelper.uncheckedCast(_session.session()); try { await _chat.setCallbackAsync(callback); _username = ChatUtils.formatUsername(_info.Username); _info.save(); setState(ClientState.Connected); } catch (Ice.CommunicatorDestroyedException) { // Ignore client session was destroyed. } catch (Exception) { destroySession(); } }
public void setError(string error) { // // Don't display errors at that point GUI is being destroyed. // if (_exit) { return; } if (_model.State == ClientState.Connected || _model.State == ClientState.ConnectionLost) { _chatView.appendError(error); setState(ClientState.ConnectionLost); } else { setState(ClientState.Disconnected); ErrorView errorView = new ErrorView(); errorView.ResizeMode = ResizeMode.NoResize; errorView.setError(error); ChatUtils.centerWindow(errorView, _mainView); errorView.ShowDialog(); } }
public LoginInfo() { _userName = ChatUtils.getSystemUsername(); load(); }