Esempio n. 1
0
        async Task DoInterval(Action <IWindow> callback, Int32 timeout, CancellationToken token)
        {
            await token.Delay(timeout).ConfigureAwait(false);

            if (token.IsCancellationRequested)
            {
                return;
            }

            _document.QueueTask(DoInterval(callback, timeout, token));
            callback(this);
        }
Esempio n. 2
0
        async Task DoTimeout(Action <IWindow> callback, Int32 timeout, CancellationToken token)
        {
            await token.Delay(timeout).ConfigureAwait(false);

            if (!token.IsCancellationRequested)
            {
                _document.QueueTask(() => callback(this));
            }
        }
Esempio n. 3
0
        private async Task DoTimeoutAsync(Action <IWindow> callback, Int32 timeout, CancellationTokenSource cts)
        {
            var token = cts.Token;
            await Task.Delay(timeout, token).ConfigureAwait(false);

            if (!token.IsCancellationRequested)
            {
                _document.QueueTask(() => callback.Invoke(this));
            }
        }