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

            pr.SetResultCallback(rc);

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

            pr.SetResultCallback(rc);

            return(rc.AwaitAsync());
        }