private Task <bool> ClearAllConnectionErrors(IRequestContext context)
        {
            TaskCompletionCallback completionCallback = new TaskCompletionCallback();

            context.ClearCertificateExceptions((ICompletionCallback)completionCallback);
            return(completionCallback.Task);
        }
Example #2
0
        internal CookieManagerDecorator(ICookieManager manager, TaskCompletionCallback callback)
        {
            if (manager == null)
            {
                throw new ArgumentNullException("manager");
            }
            if (callback == null)
            {
                throw new ArgumentNullException("manager");
            }

            this.manager = manager;

            if (callback.Task.Status == TaskStatus.RanToCompletion)
            {
                managerReady = callback.Task.Result;
            }
            else
            {
                callback.Task.ContinueWith(x =>
                {
                    managerReady = x.Result;
                });
            }
        }
        private Task <bool> CloseAllConnection(IRequestContext context)
        {
            TaskCompletionCallback completionCallback = new TaskCompletionCallback();

            context.CloseAllConnections((ICompletionCallback)completionCallback);
            return(completionCallback.Task);
        }