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(); } } }
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(); } } }
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(); } }); }