Ejemplo n.º 1
0
        public FingerprintService(
            FragmentActivity fragmentActivity,
            Context applicationContext,
            IObservable <Unit> applicationActivated,
            CoreDispatcher dispatcher,
            IScheduler backgroundScheduler,
            FuncAsync <BiometricPrompt.PromptInfo> promptInfoBuilder)
        {
            fragmentActivity.Validation().NotNull(nameof(fragmentActivity));
            applicationActivated.Validation().NotNull(nameof(applicationActivated));
            backgroundScheduler.Validation().NotNull(nameof(backgroundScheduler));
            _dispatcher        = dispatcher ?? throw new ArgumentNullException(nameof(dispatcher));
            _promptInfoBuilder = promptInfoBuilder ?? throw new ArgumentNullException(nameof(promptInfoBuilder));

            var executor = ContextCompat.GetMainExecutor(applicationContext);
            var callback = new AuthenticationCallback(OnAuthenticationSucceeded, OnAuthenticationFailed, OnAuthenticationError);

            _BiometricPrompt  = new BiometricPrompt(fragmentActivity, executor, callback);
            _BiometricManager = BiometricManager.From(Application.Context);

            _keyStore = KeyStore.GetInstance(ANDROID_KEYSTORE);
            _keyStore.Load(null);

            _canAuthenticate =
                applicationActivated
                .ObserveOn(backgroundScheduler)
                .StartWith(backgroundScheduler, Unit.Default)
                .Select(_ => _BiometricManager.CanAuthenticate())
                .Replay(1, backgroundScheduler)
                .RefCount();
        }
Ejemplo n.º 2
0
 public static IObservable <TRet> ContinueAfter <T, TRet>(this IObservable <T> observable, Func <IObservable <TRet> > selector, System.Reactive.Concurrency.IScheduler scheduler)
 {
     return(observable.AsCompletion <T>().ObserveOn(scheduler).SelectMany((Unit _) => selector()));
 }
 public static System.IObservable <TSource> Expand <TSource>(this System.IObservable <TSource> source, System.Func <TSource, System.IObservable <TSource> > selector, System.Reactive.Concurrency.IScheduler scheduler)
 {
     throw null;
 }
Ejemplo n.º 4
0
 public static System.Reactive.Concurrency.SchedulerOperation Yield(this System.Reactive.Concurrency.IScheduler scheduler, System.Threading.CancellationToken cancellationToken)
 {
     throw null;
 }
Ejemplo n.º 5
0
 public static System.Reactive.Concurrency.IStopwatch StartStopwatch(this System.Reactive.Concurrency.IScheduler scheduler)
 {
     throw null;
 }
Ejemplo n.º 6
0
 public static System.Reactive.Concurrency.SchedulerOperation Sleep(this System.Reactive.Concurrency.IScheduler scheduler, System.TimeSpan dueTime)
 {
     throw null;
 }
Ejemplo n.º 7
0
 public static System.IDisposable SchedulePeriodic <TState>(this System.Reactive.Concurrency.IScheduler scheduler, TState state, System.TimeSpan period, System.Func <TState, TState> action)
 {
     throw null;
 }
Ejemplo n.º 8
0
 public static System.IDisposable ScheduleAsync <TState>(this System.Reactive.Concurrency.IScheduler scheduler, TState state, System.TimeSpan dueTime, System.Func <System.Reactive.Concurrency.IScheduler, TState, System.Threading.CancellationToken, System.Threading.Tasks.Task> action)
 {
     throw null;
 }
Ejemplo n.º 9
0
 public static System.IObserver <T> NotifyOn <T>(this System.IObserver <T> observer, System.Reactive.Concurrency.IScheduler scheduler)
 {
     throw null;
 }
Ejemplo n.º 10
0
 public ScheduledDisposable(System.Reactive.Concurrency.IScheduler scheduler, System.IDisposable disposable)
 {
 }
Ejemplo n.º 11
0
 static Dependencies()
 {
     TimeScheduler = System.Reactive.Concurrency.DefaultScheduler.Instance;
 }
Ejemplo n.º 12
0
 internal static IObservable <T> ThrottleFirst <T>(this IObservable <T> source, TimeSpan delay, System.Reactive.Concurrency.IScheduler scheduler)
 {
     return(source.Publish(o => o.Take(1)
                           .Concat(o.IgnoreElements().TakeUntil(Observable.Return(default(T)).Delay(delay, scheduler)))
                           .Repeat()
                           .TakeUntil(o.IgnoreElements().Concat(Observable.Return(default(T))))));
 }
Ejemplo n.º 13
0
        public IObservable <IList <string> > ReadXsvAsObservable(ICollection <string> delimiters, System.Reactive.Concurrency.IScheduler scheduler)
        {
            if (scheduler == null)
            {
                scheduler = System.Reactive.Concurrency.ThreadPoolScheduler.Instance;
            }

            return(Observable.Create <IList <string> >(observer =>
            {
                CancellationTokenSource cts = new CancellationTokenSource();
                var disposable = Observable.Start(() =>
                {
                    var line = 1;
                    try
                    {
                        while (!EndOfData)
                        {
                            if (cts.IsCancellationRequested)
                            {
                                break;
                            }

                            var row = ReadXsvLine(delimiters).ToList();
                            observer.OnNext(row);
                            line++;
                        }
                        observer.OnCompleted();
                    }
                    catch (Exception e)
                    {
                        observer.OnError(new XsvReaderException(line, e.Message, e));
                    }
                }, scheduler).Subscribe(_ => { }, observer.OnError, observer.OnCompleted);

                return new CompositeDisposable(disposable, new CancellationDisposable(cts));
            }));
        }
Ejemplo n.º 14
0
 public ReactiveCommandDecorator(IObservable <bool> canExecute, Func <object, IObservable <T> > executeAsync, System.Reactive.Concurrency.IScheduler scheduler) : base(canExecute, executeAsync, scheduler)
 {
 }
Ejemplo n.º 15
0
 public static System.IDisposable Schedule(this System.Reactive.Concurrency.IScheduler scheduler, System.DateTimeOffset dueTime, System.Action <System.Action <System.DateTimeOffset> > action)
 {
     throw null;
 }
Ejemplo n.º 16
0
 public static System.IDisposable ScheduleAsync(this System.Reactive.Concurrency.IScheduler scheduler, System.Func <System.Reactive.Concurrency.IScheduler, System.Threading.CancellationToken, System.Threading.Tasks.Task <System.IDisposable> > action)
 {
     throw null;
 }
Ejemplo n.º 17
0
 public static System.Reactive.Concurrency.ISchedulerLongRunning AsLongRunning(this System.Reactive.Concurrency.IScheduler scheduler)
 {
     throw null;
 }
Ejemplo n.º 18
0
 public static System.IDisposable SchedulePeriodic(this System.Reactive.Concurrency.IScheduler scheduler, System.TimeSpan period, System.Action action)
 {
     throw null;
 }
Ejemplo n.º 19
0
 public static System.Reactive.Concurrency.ISchedulerPeriodic AsPeriodic(this System.Reactive.Concurrency.IScheduler scheduler)
 {
     throw null;
 }
Ejemplo n.º 20
0
 public static System.IDisposable Schedule <TState>(this System.Reactive.Concurrency.IScheduler scheduler, TState state, System.TimeSpan dueTime, System.Action <TState, System.Action <TState, System.TimeSpan> > action)
 {
     throw null;
 }
Ejemplo n.º 21
0
 public static System.Reactive.Concurrency.IStopwatchProvider AsStopwatchProvider(this System.Reactive.Concurrency.IScheduler scheduler)
 {
     throw null;
 }
Ejemplo n.º 22
0
 public static System.Reactive.Concurrency.SchedulerOperation Sleep(this System.Reactive.Concurrency.IScheduler scheduler, System.TimeSpan dueTime, System.Threading.CancellationToken cancellationToken)
 {
     throw null;
 }
Ejemplo n.º 23
0
 public static System.Reactive.Concurrency.IScheduler Catch <TException>(this System.Reactive.Concurrency.IScheduler scheduler, System.Func <TException, bool> handler) where TException : System.Exception
 {
     throw null;
 }
Ejemplo n.º 24
0
 public static System.Reactive.Concurrency.SchedulerOperation Yield(this System.Reactive.Concurrency.IScheduler scheduler)
 {
     throw null;
 }
Ejemplo n.º 25
0
 public static System.Reactive.Concurrency.IScheduler DisableOptimizations(this System.Reactive.Concurrency.IScheduler scheduler)
 {
     throw null;
 }
Ejemplo n.º 26
0
 public static System.IObservable <TSource> SubscribeOn <TSource>(System.IObservable <TSource> source, System.Reactive.Concurrency.IScheduler scheduler)
 {
     throw null;
 }
Ejemplo n.º 27
0
 public static System.Reactive.Concurrency.IScheduler DisableOptimizations(this System.Reactive.Concurrency.IScheduler scheduler, params System.Type[] optimizationInterfaces)
 {
     throw null;
 }
 public static System.Reactive.Linq.IQbservable <TResult> ManySelect <TSource, TResult>(this System.Reactive.Linq.IQbservable <TSource> source, System.Linq.Expressions.Expression <System.Func <System.IObservable <TSource>, TResult> > selector, System.Reactive.Concurrency.IScheduler scheduler)
 {
     throw null;
 }
Ejemplo n.º 29
0
 public static System.IDisposable Schedule(this System.Reactive.Concurrency.IScheduler scheduler, System.Action <System.Action> action)
 {
     throw null;
 }