static Task <string> _soterDevice_EnterPinCallback(PinMatrixRequestType pinType) { Console.WriteLine("Enter Pin Number:"); Console.WriteLine(" 7 8 9"); Console.WriteLine(" 4 5 6"); Console.WriteLine(" 1 2 3"); var passStr = Console.ReadLine(); return(Task.FromResult(passStr)); }
public static async Task <String> Device_EnterPinCallback(PinMatrixRequestType pinType) { var waitHandle = new EventWaitHandle(false, EventResetMode.AutoReset); var pinPage = new PinPage(pinType); pinPage.Disappearing += (sender, e) => { waitHandle.Set(); }; await _parentPage.Navigation.PushModalAsync(pinPage); await Task.Run(() => waitHandle.WaitOne()); return(PinPage.PIN); }
public PinPage(PinMatrixRequestType type) { InitializeComponent(); PIN = String.Empty; switch (type) { case PinMatrixRequestType.PinMatrixRequestTypeCurrent: titleLabel.Text = AppResources.EnterCurrentPin; break; case PinMatrixRequestType.PinMatrixRequestTypeNewFirst: titleLabel.Text = AppResources.EnterNewPin; break; case PinMatrixRequestType.PinMatrixRequestTypeNewSecond: titleLabel.Text = AppResources.ReEnterCurrentPin; break; } }
Task <string> HandleEnterPinArgs(PinMatrixRequestType pinType) { throw new Exception("Needs PIN!"); }