Ejemplo n.º 1
0
 private void call_us_Click(object sender, System.EventArgs e)
 {
     Microsoft.Phone.Tasks.PhoneCallTask pct = new Microsoft.Phone.Tasks.PhoneCallTask();
     pct.DisplayName = "micra";
     pct.PhoneNumber = "+919990357056";
     pct.Show();
 }
Ejemplo n.º 2
0
        void CallPage_Loaded(object sender, RoutedEventArgs e)
        {
            NavigationContext.QueryString.TryGetValue("name", out mName);
            NavigationContext.QueryString.TryGetValue("phone", out mPhone);

            if (mName == mPhone)
                mContactNumber.Visibility = System.Windows.Visibility.Collapsed;

            mContactName.Text = mName;
            mContactNumber.Text = mPhone;

            var img = ContactPhotoConverter.GetImageSourceForNumber(Dispatcher, mPhone);
            if (img == null)
            {
                var conn = SqliteDatabase.Connection;
                lock (SqliteDatabase.Instance)
                {
                    var findName = conn.Query<Conversation>(string.Format("SELECT OtherParticipant, Id FROM Conversation WHERE PhoneNumber LIKE '%{0}%' LIMIT 1", GoogleVoiceClient.NumbersOnly(mPhone))).FirstOrDefault();
                    if (findName != null)
                        img = ContactPhotoConverter.GetImageSourceForNumber(Dispatcher, findName.PhoneNumber);
                }
            }
            if (img != null && img != ContactPhotoConverter.unknown)
                mContactImage.Source = img;

            if (Settings.Instance.ShouldUsePINDial)
            {
                var t = new Microsoft.Phone.Tasks.PhoneCallTask();
                t.DisplayName = mName;
                t.PhoneNumber = mVoice.GetDirectDialNumber(mPhone);
                t.Show();
            }
            else
            {
                mVoice.Call(mPhone);
            }

            mTimer.Interval = new TimeSpan(0, 0, 90);
            mTimer.Tick += (a, b) =>
                {
                    try
                    {
                        mTimer.Stop();
                        NavigationService.GoBack();
                    }
                    catch (Exception)
                    {
                    }
                };
            mTimer.Start();
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Launches a phone call
 /// </summary>
 /// <param name="phone">The phone number call</param>
 public void LaunchPhone(string phone)
 {
     var task = new Microsoft.Phone.Tasks.PhoneCallTask();
     task.PhoneNumber = phone;
     task.Show();
 }