Exemplo n.º 1
0
 public void SendMessage()
 {
     ChatService.SendMessage(Username, TextToSend)
     .ContinueWith(task =>
     {
         if (task.Exception == null)
         {
             ClearTextbox_Request.Invoke();
         }
         else
         {
             ConnexionFailed_Event.Invoke();
         }
     });
 }
Exemplo n.º 2
0
        public void Login()
        {
            var scheduler = TaskScheduler.FromCurrentSynchronizationContext();

            ChatService.Connect().ContinueWith(task =>
            {
                if (task.Exception == null)
                {
                    new ChatWindow(Username, ChatService).Show();
                    CloseWindowRequest_Event.Invoke();
                }
                else
                {
                    ConnexionFailed_Event.Invoke();
                }
            }, scheduler);
        }