1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| start :declare timer; CancellationTokenSource; :declare TaskComplationSource; if(account cache exist?) then (no) :return null; stop else (yes) :declare silentRequestTask, input cancellation token; :parallel execuate silentRequestTask and TaskComplationSource.Task; fork :execuate silentRequestTask; fork again :TaskComplationSource.Task; end fork :when any task returns; if(silentRequestTask complete?) then(yes) :get result or exceptions; :return result; :release timer; :close error dialog if opened; stop else (no) :throw OperationCancelException; :set isAuthenticationCancel flag to true; :return null; stop
|