コード例 #1
0
 private void grid_5_Tapped(object sender, TappedRoutedEventArgs e)
 {
     if (ApiInformation.IsApiContractPresent("Windows.ApplicationModel.Calls.CallsPhoneContract", 1, 0))
     {
         PhoneCallManager.ShowPhoneCallUI("02324335155", "İzmir Bisim");
     }
 }
コード例 #2
0
        private async void RequestCaregiverNo()
        {
            object api = settings.Values["api"];
            object id  = settings.Values["userid"];

            if (api != null && id != null)
            {
                try
                {
                    HttpClient httpClient = new HttpClient();
                    var        response   = await httpClient.GetAsync(common.getIP() + "api/elderly/caregiverno/" + api.ToString() + "/" + id.ToString());

                    if (response.IsSuccessStatusCode)
                    {
                        string content = await response.Content.ReadAsStringAsync();

                        List <UserModel> a = JsonConvert.DeserializeObject <List <UserModel> >(content);


                        Random rnd = new Random();
                        int    num = rnd.Next(a.Count);

                        PhoneCallManager.ShowPhoneCallUI(a[num].usercontact, a[num].userfullname);
                    }
                    else
                    {
                        Debug.WriteLine("error.");
                    }
                }
                catch
                {
                    Debug.WriteLine("catch.");
                }
            }
        }
コード例 #3
0
        private async void PhoneButton_Click(object sender, RoutedEventArgs e)
        {
            var Item = this.DefaultViewModel[Restaurant] as Restaurant;

            string Telephone = Item.Telephone;

            if (Telephone != null)
            {
                Telephone = Regex.Replace(Telephone, "[^0-9]", "");

                if (Telephone.Length == 10)
                {
                    PhoneCallManager.ShowPhoneCallUI(Telephone, Item.Label);
                }
                else if (Telephone.Length == 12)
                {
                    Telephone = "+" + Telephone;
                    PhoneCallManager.ShowPhoneCallUI(Telephone, Item.Label);
                }
                else
                {
                    await ShowErrorAsync();
                }
            }
            else
            {
                this.PhoneButton.IsEnabled = false;
            }
        }
コード例 #4
0
 public void Call()
 {
     if (ApiInformation.IsTypePresent("Windows.ApplicationModel.Calls.PhoneCallManager"))
     {
         PhoneCallManager.ShowPhoneCallUI(User.PhoneNumber, User.FullName);
     }
 }
コード例 #5
0
 private void callButton_Click(object sender, RoutedEventArgs e)
 {
     if (ApiInformation.IsApiContractPresent("Windows.ApplicationModel.Calls.CallsPhoneContract", 1, 0))
     {
         PhoneCallManager.ShowPhoneCallUI(bakkal.Phone, bakkal.Name);
     }
 }
コード例 #6
0
 public void MakeCall(string phoneNumber)
 {
     if (ApiInformation.IsTypePresent("Windows.ApplicationModel.Calls.PhoneCallManager"))
     {
         PhoneCallManager.ShowPhoneCallUI(phoneNumber, phoneNumber);
     }
 }
コード例 #7
0
 private void grid_6_Tapped(object sender, TappedRoutedEventArgs e)
 {
     if (ApiInformation.IsApiContractPresent("Windows.ApplicationModel.Calls.CallsPhoneContract", 1, 0))
     {
         PhoneCallManager.ShowPhoneCallUI("4441141", "Kocaeli Çağrı Merkezi");
     }
 }
コード例 #8
0
        private async void InfoScreen(string adress, string phone, string header)
        {
            try
            {
                MessageDialog dialog        = new MessageDialog(adress + "\n" + phone, header);
                var           button_OK     = new UICommand("Ara");
                var           button_CANCEL = new UICommand("Vazgeç");

                dialog.Commands.Add(button_OK);
                dialog.Commands.Add(button_CANCEL);
                IUICommand result = await dialog.ShowAsync();

                if (result != null && result.Label == "Ara")
                {
                    if (ApiInformation.IsApiContractPresent("Windows.ApplicationModel.Calls.CallsPhoneContract", 1, 0))
                    {
                        PhoneCallManager.ShowPhoneCallUI(phone.Trim(), header);
                    }
                }
            }

            catch (Exception)
            {
            }
        }
コード例 #9
0
        private void GenerateActions()
        {
            ProfileCommands = new ObservableCollection <ProfileCommand>();

            //Mise en place des champs de commande
            //Commande pour appeler
            if (!_userModel.numeroPortable.Equals(""))
            {
                Action command;
                //Si on peut appeler
                if (ApiInformation.IsApiContractPresent("Windows.ApplicationModel.Calls.CallsPhoneContract", 1, 0))
                {
                    command = new Action(() =>
                    {
                        PhoneCallManager.ShowPhoneCallUI(_userModel.numeroPortable, Username);
                    });
                }
                //Si le device ne peut passer d'appel
                else
                {
                    command = new Action(async() =>
                    {
                        string errMsg        = "Désolé, les appels ne sont pas disponnibles sur votre appareil";
                        MessageDialog dialog = new MessageDialog(errMsg);
                        await dialog.ShowAsync();
                    });
                }
                ProfileCommands.Add(new ProfileCommand("Appeler", _userModel.numeroPortable, command));
            }
            //Commande pour naviguer vers
            if (!_userModel.adresse.Equals(""))
            {
                Action command = new Action(async() =>
                {
                    var locFinderResult = await MapLocationFinder.FindLocationsAsync(_userModel.adresse, new Geopoint(new BasicGeoposition()));

                    if (locFinderResult.Locations[0] == null)
                    {
                        string errMsg        = "Désolé, impossible de trouver où " + _userModel.prenom + " habite";
                        MessageDialog dialog = new MessageDialog(errMsg);
                        await dialog.ShowAsync();
                        return;
                    }

                    var geoPos = locFinderResult.Locations[0].Point.Position;

                    var driveToUri = new Uri(String.Format(
                                                 "ms-drive-to:?destination.latitude={0}&destination.longitude={1}&destination.name={2}",
                                                 geoPos.Latitude,
                                                 geoPos.Longitude,
                                                 _userModel.prenom + " " + _userModel.nom));

                    await Windows.System.Launcher.LaunchUriAsync(driveToUri);
                });

                ProfileCommands.Add(new ProfileCommand("Obtenir un itinéraire", _userModel.adresse, command));
                RaisePropertyChanged("ProfileCommands");
            }
        }
コード例 #10
0
        private void TextBlock_Tapped(object sender, TappedRoutedEventArgs e)
        {
            TextBlock txtBlock = sender as TextBlock;
            string    num      = txtBlock.Text;
            string    name     = this.txtTitle.Text;

            PhoneCallManager.ShowPhoneCallUI(num, name);
        }
コード例 #11
0
        public void Phone(string number, string name)
        {
            //if(!CanPhone)
            //{
            //    throw new System.Exception("Sarac");
            //}

            PhoneCallManager.ShowPhoneCallUI(number, name);
        }
コード例 #12
0
        private void list_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            var value = (Card)list.SelectedItem;

            if (ApiInformation.IsApiContractPresent("Windows.ApplicationModel.Calls.CallsPhoneContract", 1, 0))
            {
                PhoneCallManager.ShowPhoneCallUI(value.PhoneNumber, value.Name);
            }
        }
コード例 #13
0
        private void CallExecute()
        {
            PhoneCallManager.ShowPhoneCallUI(Post.PhoneNumber, "@" + Post.User);

            _insightsService.TrackEvent("ContactCall",
                                        new Dictionary <string, string>
            {
                { "PostId", Post.Id }
            });
        }
コード例 #14
0
 private void Dial_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         PhoneCallManager.ShowPhoneCallUI(PhoneNumberTextBox.Text, "Jon Doe");
     }
     catch (Exception ex)
     {
         ErrorMessage.Text = ex.ToString();
     }
 }
コード例 #15
0
        /// <summary>
        /// Method invoked when the user clicks on Richiama button.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void AppBarButton_Tapped_2(object sender, TappedRoutedEventArgs e)
        {
            FrameworkElement element = (FrameworkElement)sender;
            Message          message = (Message)element.DataContext;

            try
            {
                PhoneCallManager.ShowPhoneCallUI(message.Sender, message.Sender);
            }
            catch (Exception ex) { ShellPage.Current.HandleExceptionNotification(ex); }
        }
コード例 #16
0
 //打电话
 public static void CallFunc()
 {
     try
     {
         PhoneCallManager.ShowPhoneCallUI(18317722768.ToString(), "hippieZhou");
     }
     catch (Exception ex)
     {
         Debug.WriteLine(ex.Message);
     }
 }
コード例 #17
0
        public virtual Task ShowAsync(string phoneNumber, string displayName)
        {
            if (Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.ApplicationModel.Calls.PhoneCallManager"))
            {
                PhoneCallManager.ShowPhoneCallUI(phoneNumber, displayName);

                return(Task.CompletedTask);
            }

            return(CallByUri(phoneNumber, displayName));
        }
コード例 #18
0
        public void MakePhoneCall(string number, string name = null)
        {
            if (string.IsNullOrWhiteSpace(number))
            {
                throw new ArgumentNullException("number");
            }

            if (CanMakePhoneCall)
            {
                PhoneCallManager.ShowPhoneCallUI(number, name ?? "");
            }
        }
コード例 #19
0
ファイル: BloodBank.xaml.cs プロジェクト: UTSAVA/MedBook
        private void listBox1_ItemClick(object sender, ItemClickEventArgs e)
        {
            string l = e.ClickedItem.ToString();

            //ans.Text = l;
            string[] line = new string[10];
            line = l.Split(',');
            // ans.Text = line[0];
            //ans.Text = l;
            line[2] = line[2].Replace("\"", string.Empty);
            PhoneCallManager.ShowPhoneCallUI(line[0], line[2]);
        }
コード例 #20
0
        public void ShowPhoneCallUI(string phoneNumber, string displayName)
        {
            if (phoneNumber == null)
            {
                throw new ArgumentNullException(nameof(phoneNumber));
            }
            if (displayName == null)
            {
                throw new ArgumentNullException(nameof(displayName));
            }

            PhoneCallManager.ShowPhoneCallUI(phoneNumber, displayName);
        }
コード例 #21
0
        private void lista_DoubleTapped(object sender, DoubleTappedRoutedEventArgs e)
        {
            string SelectedContactId = "0";
            string callnome;

            if (lista.SelectedIndex != -1)
            {
                ContactsDataModel listitem = lista.SelectedItem as ContactsDataModel;
                SelectedContactId = Convert.ToString(listitem.Model.C_telemovel);
                callnome          = listitem.Model.C_nome;
                PhoneCallManager.ShowPhoneCallUI("+351" + SelectedContactId, callnome);
            }
        }
コード例 #22
0
        /// <summary>
        /// Shows the Phone application, using the specified phone number and display name.
        /// </summary>
        /// <param name="phoneNumber">The phone number.</param>
        /// <param name="displayName">The display name.</param>
        public void Show(string phoneNumber, string displayName)
        {
#if WINDOWS_PHONE
            new PhoneCallTask()
            {
                PhoneNumber = phoneNumber,
                DisplayName = displayName
            }.Show();
#elif WINDOWS_PHONE_APP
            PhoneCallManager.ShowPhoneCallUI(phoneNumber, displayName);
#else
            var phoneCallUrl = "tel:" + Uri.EscapeDataString(phoneNumber);

            Launcher.LaunchUriAsync(new Uri(phoneCallUrl, UriKind.Absolute));
#endif
        }
コード例 #23
0
        private void SystemCallExecute()
        {
            var user = Item as TLUser;

            if (user != null)
            {
                if (ApiInformation.IsTypePresent("Windows.ApplicationModel.Calls.PhoneCallManager"))
                {
                    PhoneCallManager.ShowPhoneCallUI($"+{user.Phone}", user.FullName);
                }
                else
                {
                    // TODO
                }
            }
        }
 private async void BtnCall_Click(object sender, RoutedEventArgs e)
 {
     if (ApiInformation.IsApiContractPresent("Windows.Phone.PhoneContract", 1, 0))
     {
         PhoneCallManager.ShowPhoneCallUI("+48 000-000-000", "Marcin Jamro");
     }
     else
     {
         ContentDialog dialog = new ContentDialog()
         {
             Content           = "We are sorry, but the device does not support calling.",
             PrimaryButtonText = "OK"
         };
         await dialog.ShowAsync();
     }
 }
コード例 #25
0
ファイル: TelephonyService.cs プロジェクト: moinnn/telephony
        public virtual Task MakePhoneCall(string recipient, string displayName = null)
        {
            if (string.IsNullOrWhiteSpace(recipient))
            {
                throw new ArgumentNullException("recipient",
                                                "Supplied argument 'recipient' is null, whitespace or empty.");
            }

            if (!CanMakePhoneCall)
            {
                throw new FeatureNotAvailableException();
            }

            PhoneCallManager.ShowPhoneCallUI(recipient, displayName);

            return(Task.FromResult(true));
        }
コード例 #26
0
ファイル: MapView.xaml.cs プロジェクト: pnp0a03/WinGo-Maps
 private void PlacePhone_Click(object sender, TappedRoutedEventArgs e)
 {
     PhoneCallManager.ShowPhoneCallUI(PlacePhone.Text, PlaceName.Text);
 }
コード例 #27
0
 public bool Dial(string number)
 {
     PhoneCallManager.ShowPhoneCallUI(number, "Phoneword");
     return(true);
 }
コード例 #28
0
 public void Show()
 {
     PhoneCallManager.ShowPhoneCallUI(PhoneNumber, DisplayName);
 }
コード例 #29
0
        public static void Open(string number)
        {
            ValidateOpen(number);

            PhoneCallManager.ShowPhoneCallUI(number, string.Empty);
        }
コード例 #30
0
 private void Action_Call(String Name, String Number)
 {
     PhoneCallManager.ShowPhoneCallUI(Number, Name);
 }