예제 #1
0
 public void SendMessage()
 {
     ChatService.SendMessage(Username, TextToSend)
     .ContinueWith(task =>
     {
         if (task.Exception == null)
         {
             ClearTextbox_Request.Invoke();
         }
         else
         {
             ConnexionFailed_Event.Invoke();
         }
     });
 }
예제 #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);
        }