private void Csll_Dial(object sender, EventArgs e) { System.Diagnostics.Debug.WriteLine("전화를 겁니다 "); IDialer dialer = DependencyService.Get <IDialer>(); if (dialer == null) { System.Diagnostics.Debug.WriteLine(" 빈객체 입니다."); } else { dialer.dial("010 - 7535 - 7836"); System.Diagnostics.Debug.WriteLine("010 - 7535 - 7836 번호로 전화를 겁니다"); } JeongSound sound = DependencyService.Get <JeongSound>(); if (sound == null) { System.Diagnostics.Debug.WriteLine("빈객체 입니다."); } else { sound.SoundPlayer("asd"); } }
private async void CallButton_Clicked(object sender, EventArgs e) { if (await this.DisplayAlert("Dial a Number", "Would you like to call " + translatedNumber + "?", "Yes", "No")) { IDialer dialer = DependencyService.Get <IDialer>(); if (dialer != null) { await dialer.DialAsync(translatedNumber); } } }
public TcpDialer(TcpTransport t, Multiaddress laddr, TimeSpan?timeout, bool reusePort) { var la = laddr.ToEndPoint(); if (la == null) { throw new Exception("Invalid address"); } _transport = t; _dialer = new SocketDialer(laddr, timeout, reusePort); }
async void OnCall(object sender, EventArgs e) { bool result = await this.DisplayAlert(title : "Dial a Number", message : $"Would you like to call {phoneNum}", accept : "Yes", cancel : "No"); if (result) { // TODO: dial the phone IDialer dialer = DependencyService.Get <IDialer>(); if (dialer != null) { await dialer.DialAsync(phoneNum); } } }
async void OnCall(object obj, EventArgs args) { bool answer = await DisplayAlert("Dia; a Number", "Would you like to call " + translatedNumber + "?", "Yes", "No"); if (answer) { // Get Implementation with Dependency Service IDialer dialer = DependencyService.Get <IDialer>(); if (dialer != null) { // Call the methd in platform await dialer.DialAsync(translatedNumber); } } }
//private void OnTranslate(object sender, EventArgs e) //{ // string enteredNumber = numberEntry.Text; // string translatedNumber = PhonewordTranslator.ToNumber(enteredNumber); // if (!string.IsNullOrEmpty(translatedNumber)) // { // callButton.Text = "Call " + translatedNumber; // callButton.IsEnabled = true; // } // else { // callButton.Text = "Call"; // callButton.IsEnabled = false; // } //} async void OnCall(object sender, EventArgs e) { int numeroTelefone = 0; string enteredNumber = numberEntry.Text; string translatedNumber = PhonewordTranslator.ToNumber(enteredNumber); //asynchronous 'await' keyword for this method if (await this.DisplayAlert("Dial a Number", "Você gostaria de ligar para " + translatedNumber + "?", "Sim", "Não")) { IDialer dialer = DependencyService.Get <IDialer>(); if (dialer != null) { await dialer.DialAsync(translatedNumber); numeroTelefone = Int32.Parse(numberEntry.Text); numeroTelefone++; numberEntry.Text = numeroTelefone.ToString(); } } }
public MainViewModel(IDialer dialer) { Dialer = dialer; }
public MainViewModel(IDialer dialer, IPhonewordTranslator phonewordTranslator, ISpeech speech) { this.Dialer = dialer; this.PhonewordTranslator = phonewordTranslator; this.Speech = speech; }
private void CallOnClick(string number) { IDialer dialer = DependencyService.Get <IDialer>(); dialer.startDialer(number); }