Наследование: IRSessionInteraction
        public void Request(string prompt, int maxLength, TaskCompletionSource<string> requestTcs) {
            var request = new RSessionInteraction(requestTcs, _responseTcs, prompt, maxLength, Contexts);
            if (_createRequestTcs.TrySetResult(request)) {
                return;
            }

            request.Dispose();
            if (CreateRequestTask.IsCanceled) {
                throw new OperationCanceledException();
            }
        }
Пример #2
0
        public void Request(IReadOnlyList<IRContext> contexts, string prompt, int maxLength, TaskCompletionSource<string> requestTcs) {
            var request = new RSessionInteraction(requestTcs, _responseTcs.Task, prompt, maxLength, contexts ?? new[] { RHost.TopLevelContext });
            if (_createRequestTcs.TrySetResult(request)) {
                _cancellationTokenRegistration.Dispose();
                return;
            }

            request.Dispose();
            if (CreateRequestTask.IsCanceled) {
                throw new OperationCanceledException();
            }
        }
Пример #3
0
        public void Request(string prompt, int maxLength, TaskCompletionSource <string> requestTcs)
        {
            var request = new RSessionInteraction(requestTcs, _responseTcs, prompt, maxLength, Contexts);

            if (_createRequestTcs.TrySetResult(request))
            {
                return;
            }

            request.Dispose();
            if (CreateRequestTask.IsCanceled)
            {
                throw new OperationCanceledException();
            }
        }
Пример #4
0
        public void Request(IReadOnlyList <IRContext> contexts, string prompt, int maxLength, TaskCompletionSource <string> requestTcs)
        {
            var request = new RSessionInteraction(requestTcs, _responseTcs.Task, prompt, maxLength, contexts ?? new[] { RHost.TopLevelContext });

            if (_createRequestTcs.TrySetResult(request))
            {
                return;
            }

            request.Dispose();
            if (CreateRequestTask.IsCanceled)
            {
                throw new OperationCanceledException();
            }
        }