AwaiterResultable.cs 432 B

123456789101112131415
  1. namespace XGame.Framework.Asyncs
  2. {
  3. public class AwaiterResultable<TResult> : Awaiter, IAsyncResultable<TResult>
  4. {
  5. TResult _Result;
  6. public TResult Result => _Result;
  7. public override void Completed(IAsync result)
  8. {
  9. if (result is IAsyncResultable<TResult>)
  10. _Result = (result as IAsyncResultable<TResult>).Result;
  11. base.Completed(result);
  12. }
  13. }
  14. }