示例#1
0
        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);
            }
        }
示例#2
0
        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);
                }
            }
        }