예제 #1
0
        /// <summary>
        /// ProcessRequests processes all registered requests. If the page is asynchronous then the requests will be submitted asynchronously. Otherwise the responses will be returned synchronously.
        /// </summary>
        /// <param name="page">The page instance on which this instance is defined.</param>
        public void ProcessRequests(Page page)
        {
            if (NothingToProcess)
            {
                isProcessed = true;
                if (AllIsCached)
                {
                    OnResponseReady();
                }
                return;
            }

            isProcessed = true;
            if (page != null && page.IsAsync)
            {
                Log.LogEntry.Categories(CategoryFlags.Debug).Message("Processing async request. Thread: [{0}]", Thread.CurrentThread.ManagedThreadId).WriteVerbose();
                page.RegisterAsyncTask(new PageAsyncTask(AsyncTask));
            }
            else
            {
                Log.LogEntry.Categories(CategoryFlags.Debug).Message("Processing sync request. Thread: [{0}]", Thread.CurrentThread.ManagedThreadId).WriteVerbose();

                try
                {
                    var responses = ExposeProxy.Process(RequestList);
                    PopulateResponses(responses);
                }
                catch (Exception ex) { exception = ex; OnResponseReady(); }
            }
        }
예제 #2
0
        private string GetCertificateThumbprint()
        {
            if (exposeProxy == null)
            {
// ReSharper disable once UnusedVariable
                var justARefToCreateProxy = ExposeProxy.GetType();
            }
            return(exposeProxy?.ClientCredentials?.ClientCertificate.Certificate?.Thumbprint);
        }
예제 #3
0
        private async Task AsyncTask()
        {
            try
            {
                var data = await ExposeProxy.ProcessAsync(RequestList);

                PopulateResponses(data);
            }
            catch (Exception ex) { exception = ex; OnResponseReady(); }
        }
예제 #4
0
        /// <summary>
        /// ProcessRequests processes all registered requests. The responses will be returned synchronously.
        /// </summary>
        public async Task ProcessRequestsAsync()
        {
            var responses = ExposeProxy.ProcessAsync(RequestList);

            PopulateResponses(await responses);
        }