Exemple #1
0
        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();
            }
        }
Exemple #2
0
 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();
     }
 }
Exemple #3
0
 public LoginInfo()
 {
     _userName = ChatUtils.getSystemUsername();
     load();
 }