예제 #1
0
        public static Task GetTask(FutureVoid fu)
        {
            TaskCompletionSource <int> tcs = new TaskCompletionSource <int>();

            if (fu.status() == FutureStatus.Invalid)
            {
                tcs.SetException(new FirebaseException(0, "Asynchronous operation was not started."));
                return(tcs.Task);
            }
            fu.SetOnCompletionCallback(delegate
            {
                if (fu.status() == FutureStatus.Invalid)
                {
                    tcs.SetCanceled();
                }
                else
                {
                    int num = fu.error();
                    if (num != 0)
                    {
                        tcs.SetException(new FirebaseException(num, fu.error_message()));
                    }
                    else
                    {
                        tcs.SetResult(0);
                    }
                }
                fu.Dispose();
            });
            return(tcs.Task);
        }
예제 #2
0
 internal static HandleRef getCPtr(FutureVoid obj)
 {
     return((obj != null) ? obj.swigCPtr : new HandleRef(null, IntPtr.Zero));
 }
예제 #3
0
 public static Task FixAndroidDependenciesAsync()
 {
     return(FutureVoid.GetTask(new FutureVoid(AppUtilPINVOKE.FixAndroidDependencies(), true)));
 }