private async Task JoinFunction()
        {
            try {
                var result = await server.JoinRoom(RoomName);

                if (result == true)
                {
                    var addUserRoom = await server.CreateUserRoom(new UserRoom()
                    {
                        Room = RoomName, Email = App.CurrentUserEmail
                    });

                    await Shell.Current.Navigation.PushPopupAsync(new InfoPopup("Info", addUserRoom.response));
                }
                else
                {
                    throw new Exception("Room does not exist!!");
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("STH HAPPEND");
                await Shell.Current.Navigation.PushPopupAsync(new InfoPopup("Erro", ex.Message));
            }
        }
예제 #2
0
        public async Task CreateRoom()
        {
            try
            {
                var result = await server.JoinRoom(RoomName);

                if (result == false)
                {
                    var addUserRoom = await server.CreateUserRoom(new UserRoom()
                    {
                        Room = RoomName, Email = App.CurrentUserEmail
                    });

                    //var stringContent = JsonConvert.SerializeObject(addUserRoom) as ResponseModel;
                    await Shell.Current.Navigation.PushPopupAsync(new InfoPopup("Info", addUserRoom.response));
                }
                else
                {
                    throw new Exception("Room already exists!!");
                }
            }
            catch (Exception ex) {
                await Shell.Current.Navigation.PushPopupAsync(new InfoPopup("Error", ex.Message));
            }
        }