private static async void TryToStop(RemoteRequestTask task, Action <ShootingResult> Finished) { try { await task(); Finished?.Invoke(ShootingResult.StopSucceed); } catch (RemoteApiException ex) { DebugUtil.Log(() => ex.StackTrace); Finished?.Invoke(ShootingResult.StopFailed); } }
private static async void TryToStart(RemoteRequestTask task, Action <ShootingResult> Finished) { try { await task(); if (Finished != null) { Finished.Invoke(ShootingResult.StartSucceed); } } catch (RemoteApiException ex) { DebugUtil.Log(ex.StackTrace); if (Finished != null) { Finished.Invoke(ShootingResult.StartFailed); } } }