Ejemplo n.º 1
0
        public async void connected(SessionHelper session)
        {
            // If the session has been reassigned avoid the
            // spurious callback.
            if (session != _session)
            {
                return;
            }

            Ice.Object servant = new ChatCallbackI(this);

            ChatCallbackPrx callback = Demo.ChatCallbackPrxHelper.uncheckedCast(_session.addWithUUID(servant));

            _chat = ChatSessionPrxHelper.uncheckedCast(_session.session());
            try
            {
                await _chat.setCallbackAsync(callback);

                closeCancelDialog();
                input.IsEnabled = true;
                status.Content  = "Connected with " + _loginData.routerHost;
            }
            catch (Exception)
            {
                if (_session != null)
                {
                    _session.destroy();
                }
            }
        }
Ejemplo n.º 2
0
        public void connected(SessionHelper session)
        {
            // If the session has been reassigned avoid the
            // spurious callback.
            if (session != _session)
            {
                return;
            }

            Ice.Object servant = new ChatCallbackI(this);

            Demo.ChatCallbackPrx callback = Demo.ChatCallbackPrxHelper.uncheckedCast(_session.addWithUUID(servant));
            _chat = Demo.ChatSessionPrxHelper.uncheckedCast(_session.session());
            _chat.begin_setCallback(callback).whenCompleted(delegate()
            {
                closeCancelDialog();
                input.IsEnabled = true;
                status.Content  = "Connected with " + _loginData.routerHost;
            },
                                                            delegate(Ice.Exception ex)
            {
                if (_session != null)
                {
                    _session.destroy();
                }
            });
        }
        public async void connected(SessionHelper session)
        {
            // If the session has been reassigned avoid the
            // spurious callback.
            if(session != _session)
            {
                return;
            }

            Ice.Object servant = new ChatCallbackI(this);

            ChatCallbackPrx callback = Demo.ChatCallbackPrxHelper.uncheckedCast(_session.addWithUUID(servant));
            _chat = ChatSessionPrxHelper.uncheckedCast(_session.session());
            try
            {
                await _chat.setCallbackAsync(callback);
                closeCancelDialog();
                input.IsEnabled = true;
                status.Content = "Connected with " + _loginData.routerHost;
            }
            catch(Exception)
            {
                if(_session != null)
                {
                    _session.destroy();
                }
            }
        }
Ejemplo n.º 4
0
        public void connected(SessionHelper session)
        {
            // If the session has been reassigned avoid the
            // spurious callback.
            if(session != _session)
            {
                return;
            }

            Ice.Object servant = new ChatCallbackI(this);

            Demo.ChatCallbackPrx callback = Demo.ChatCallbackPrxHelper.uncheckedCast(_session.addWithUUID(servant));
            _chat = Demo.ChatSessionPrxHelper.uncheckedCast(_session.session());
            _chat.begin_setCallback(callback).whenCompleted(delegate()
                                              {
                                                  closeCancelDialog();
                                                  input.IsEnabled = true;
                                                  status.Content = "Connected with " + _loginData.routerHost;
                                              },
                                              delegate(Ice.Exception ex)
                                              {
                                                  if(_session != null)
                                                  {
                                                      _session.destroy();
                                                  }
                                              });
        }