private async Task FetchForumDetails(List <Course> CourseList)
 {
     if (CrossConnectivity.Current.IsConnected)
     {
         ChatHandler.GetChatRoom(
             (response) => {
             this.GetForumViewModel(response.ChatRoomData, CourseList);
         },
             (errorResponse) => {
             NavigationHandler.GlobalNavigator.DisplayAlert(Constants.APP_NAME, Constants.ServerUnSuccess, Constants.OK_TEXT);
         });
     }
     else
     {
         NavigationHandler.GlobalNavigator.DisplayAlert(Constants.APP_NAME, Constants.NETWORK_ERROR, Constants.OK_TEXT);
     }
 }
Exemple #2
0
 private async Task ExitChat()
 {
     if (CrossConnectivity.Current.IsConnected)
     {
         ChatHandler.ExitChat(_RoomDetail.RoomID, _RoomDetail.CourseID, App.UserName,
                              (response) => {
             //user exits from chat
             _IsEntered = false;
         },
                              (error) => {
             NavigationHandler.LoginNavigator.DisplayAlert(Constants.APP_NAME, Constants.ServerUnSuccess, Constants.OK_TEXT);
         }
                              );
     }
     else
     {
         NavigationHandler.ForumNavigator.DisplayAlert(Constants.APP_NAME, this.YourMessage, Constants.OK_TEXT);
     }
 }
Exemple #3
0
 private async Task GetMessages()
 {
     if (CrossConnectivity.Current.IsConnected)
     {
         ChatHandler.GetChatMessage(_RoomDetail.RoomID, _RoomDetail.CourseID,
                                    (response) =>
         {
             GetViewModel(response.ChatData);
         },
                                    (error) =>
         {
             //Todo
             NavigationHandler.LoginNavigator.DisplayAlert(Constants.APP_NAME, "Chat Room Is Empty", Constants.OK_TEXT);
         });
     }
     else
     {
         NavigationHandler.GlobalNavigator.DisplayAlert(Constants.APP_NAME, Constants.NETWORK_ERROR, Constants.OK_TEXT);
     }
 }
Exemple #4
0
 private async Task EnterChat()
 {
     if (CrossConnectivity.Current.IsConnected)
     {
         ChatHandler.EnterChatRoom(_RoomDetail.RoomID, _RoomDetail.CourseID, App.UserName,
                                   (response) => {
             //user enters into the chat.
             _IsEntered = true;
         },
                                   async(error) => {
             _IsEntered = false;
             await NavigationHandler.GlobalNavigator.DisplayAlert(Constants.APP_NAME, Constants.ServerUnSuccess, Constants.OK_TEXT);
             NavigationHandler.GlobalNavigator.PopAsync();
         }
                                   );
     }
     else
     {
         NavigationHandler.ForumNavigator.DisplayAlert(Constants.APP_NAME, this.YourMessage, Constants.OK_TEXT);
     }
 }
Exemple #5
0
        // To synchronize new recieved messages == initializeTimer
        private async Task ReieveOthersMessages()
        {
            String LastUpdatedTime = "balraj";

            if (CrossConnectivity.Current.IsConnected)
            {
                ChatHandler.GetOthersMessage(_RoomDetail.RoomID, _RoomDetail.CourseID, App.UserName,
                                             (response) =>
                {
                    GetViewModel(response.ChatData);
                },
                                             (error) =>
                {
                    //Todo
                    NavigationHandler.LoginNavigator.DisplayAlert(Constants.APP_NAME, "Chat Room Is Empty", Constants.OK_TEXT);
                });
            }
            else
            {
                NavigationHandler.GlobalNavigator.DisplayAlert(Constants.APP_NAME, Constants.NETWORK_ERROR, Constants.OK_TEXT);
            }
        }