async void RequestListener_NoDriverAcceptedRequest(object sender, EventArgs e)
        {
            try
            {
                RunOnUiThread(() =>
                {
                    if (requestDriverFragment != null && requestListener != null)
                    {
                        requestListener.CancelRequestOnTimeout();
                        requestListener = null;
                        requestDriverFragment.Dismiss();
                        requestDriverFragment = null;

                        Android.Support.V7.App.AlertDialog.Builder alert = new Android.Support.V7.App.AlertDialog.Builder(this);
                        alert.SetTitle("Message");
                        alert.SetMessage("Available Drivers Couldn't Accept Your Ride Request, Try again in a few mnoment");
                        alert.Show();
                    }
                });
                if (!IsConnected)
                {
                    await ConnectAsync();
                }
                await hubConnection.InvokeAsync("CancelRequest", "timeout");
            }
            catch (Exception ex)
            {
                ExceptionDialogue("Error", ex.Message);
            }
        }
Beispiel #2
0
        void RequestListener_NoDriverAcceptedRequest(object sender, EventArgs e)
        {
            RunOnUiThread(() =>
            {
                if (requestDriverFragment != null && requestListener != null)
                {
                    requestListener.CancelRequestOnTimeout();
                    requestListener = null;
                    requestDriverFragment.Dismiss();
                    requestDriverFragment = null;

                    Android.Support.V7.App.AlertDialog.Builder alert = new Android.Support.V7.App.AlertDialog.Builder(this);
                    alert.SetTitle("Message");
                    alert.SetMessage("Available Drivers Couldn't Accept Your Ride Request, Try again in a few mnoment");
                    alert.Show();
                }
            });
        }
        private void RequestListener_NoDriverAcceptedRequest(object sender, EventArgs e)
        {
            InvokeOnMainThread(() =>
            {
                if (!requestCabView.Hidden)
                {
                    //Hide Views
                    overlay.Hidden        = true;
                    requestCabView.Hidden = true;
                    requestListener.CancelRequestOnTimeout();

                    // Display Alert
                    string alertstring = "No available driver accepted your request";
                    var alert          = UIAlertController.Create("Alert", alertstring, UIAlertControllerStyle.Alert);
                    alert.AddAction(UIAlertAction.Create("Ok", UIAlertActionStyle.Default, null));
                    PresentViewController(alert, true, null);
                }
            });
        }