public static TaskAwaiter <IResult> GetAwaiter(this PendingResult pr)
        {
            var rc = new AwaitableResultCallback <IResult> ();

            pr.SetResultCallback(rc);

            return(rc.GetAwaiter());
        }
        public static async Task AsAsync(this PendingResult pr)
        {
            var rc = new AwaitableResultCallback <Statuses> ();

            pr.SetResultCallback(rc);

            await rc.AwaitAsync();
        }
        public static TaskAwaiter <TResult> GetAwaiter <TResult> (this PendingResult pr) where TResult : class, IResult
        {
            var rc = new AwaitableResultCallback <TResult> ();

            pr.SetResultCallback(rc);

            return(rc.GetAwaiter());
        }
        public static Task <TResult> AsAsync <TResult> (this PendingResult pr) where TResult : class, IResult
        {
            var rc = new AwaitableResultCallback <TResult> ();

            pr.SetResultCallback(rc);

            return(rc.AwaitAsync());
        }