Beispiel #1
0
 public static void MakeSamplePhoneCall(this IPhoneCallTask phoneCall)
 {
     if (phoneCall.CanMakePhoneCall)
     {
         phoneCall.MakePhoneCall("+27219330000", "Xamarin Demo User");
     }
 }
        private void ClickPhone(Phone phone)
        {
            if (phone == null)
            {
                return;
            }

            ActionSheetConfig config = new ActionSheetConfig();

            config.Add(ResourceService.GetString("callAction"), () =>
            {
                IPhoneCallTask phoneDialer = CrossMessaging.Current.PhoneDialer;
                if (!phoneDialer.CanMakePhoneCall)
                {
                    UserDialogs.Instance.Alert(ResourceService.GetString("cannotCall"));
                    return;
                }
                phoneDialer.MakePhoneCall(phone.Number);
            });
            config.Add(ResourceService.GetString("messageAction"), () =>
            {
                ISmsTask smsMessenger = CrossMessaging.Current.SmsMessenger;
                if (!smsMessenger.CanSendSms)
                {
                    UserDialogs.Instance.Alert(ResourceService.GetString("cannotSms"));
                    return;
                }
                smsMessenger.SendSms(phone.Number);
            });
            config.Add(ResourceService.GetString("cancelAction"));
            UserDialogs.Instance.ActionSheet(config);
        }
        private void Call(object sender, EventArgs e)
        {
            IPhoneCallTask phoneCall = CrossMessaging.Current.PhoneDialer;

            if (phoneCall.CanMakePhoneCall &&
                !String.IsNullOrEmpty(txtPhoneNumber.Text))
            {
                phoneCall.MakePhoneCall(txtPhoneNumber.Text);
            }
        }
Beispiel #4
0
        private void ClickPhone(Phone phone)
        {
            if (phone == null)
            {
                return;
            }

            ActionSheetConfig config = new ActionSheetConfig();

            config.Add(ResourceService.GetString("callAction"), () =>
            {
                IPhoneCallTask phoneDialer = CrossMessaging.Current.PhoneDialer;
                if (!phoneDialer.CanMakePhoneCall)
                {
                    UserDialogs.Instance.Alert(ResourceService.GetString("cannotCall"));
                    return;
                }
                phoneDialer.MakePhoneCall(phone.Number);
            });
            config.Add(ResourceService.GetString("messageAction"), () =>
            {
                ISmsTask smsMessenger = CrossMessaging.Current.SmsMessenger;
                if (!smsMessenger.CanSendSms)
                {
                    UserDialogs.Instance.Alert(ResourceService.GetString("cannotSms"));
                    return;
                }
                smsMessenger.SendSms(phone.Number);
            });
            config.Add(ResourceService.GetString("editAction"), () =>
            {
                EditPhone(phone);
            });
            config.Add(ResourceService.GetString("deleteAction"), () =>
            {
                if (Debtor == null || Debtor.Phones.IsNullOrEmpty())
                {
                    return;
                }

                UserDialogs.Instance.Confirm(ResourceService.GetString("reallyDelete"),
                                             ResourceService.GetString("yes"),
                                             ResourceService.GetString("no"),
                                             (accepted) =>
                {
                    if (accepted)
                    {
                        Debtor.Phones.Remove(phone);
                    }
                });
            });
            config.Add(ResourceService.GetString("cancelAction"));
            UserDialogs.Instance.ActionSheet(config);
        }
Beispiel #5
0
 private async void Call_Tapped(object sender, EventArgs e)
 {
     try
     {
         IPhoneCallTask phoneDialer = CrossMessaging.Current.PhoneDialer;
         if (phoneDialer.CanMakePhoneCall)
         {
             phoneDialer.MakePhoneCall(client.Phone);
         }
     }
     catch (Exception ex)
     {
         await DisplayAlert("Ошибка", ex.Message, "OK");
     }
 }
        async Task OnInformationListCommand(DisplayInformation displayInformation)
        {
            switch (displayInformation.DisplayInformationType)
            {
            case DisplayInformationType.Contact:
                if (await _pageDialogService.DisplayAlertAsync("Call", $"Call {displayInformation.MainText} on {displayInformation.Subtext}", "Call", "Cancel"))
                {
                    _phoneCallTask.MakePhoneCall(displayInformation.Subtext, displayInformation.MainText);
                }
                break;

            case DisplayInformationType.Location:
                await _externalMaps.NavigateTo(DisplayCaseDetails.Name, SelectedCase.Patient.PatientAddress1, SelectedCase.Patient.PatientCity, SelectedCase.Patient.PatientState, SelectedCase.Patient.PatientZip, "USA", "USA");

                break;
            }
        }