Beispiel #1
0
        private void HandleTimeout(object state)
        {
            if (state != null && (bool)state)
            {
                tcs.TrySetCanceled();
            }

            if (bestPosition != null)
            {
                tcs.TrySetResult(bestPosition.ToPosition());
            }
            else
            {
                tcs.TrySetCanceled();
            }
        }