コード例 #1
0
        /// <summary>
        /// Create a new web resource response object. The headers is the
        /// raw response header string delimited by newline. It's also possible to
        /// create this object with empty headers string and then use the
        /// IWebView2HttpResponseHeaders to construct the headers line by line.
        /// For information on other parameters see IWebView2WebResourceResponse.
        ///
        /// </summary>
        /// <param name="content"></param>
        /// <param name="statusCode"></param>
        /// <param name="reasonPhrase"></param>
        /// <param name="headers"></param>
        /// <param name="response"></param>
        public WebView2WebResourceResponse CreateWebResourceResponse(IStream content, int statusCode, string reasonPhrase, string headers)
        {
            ICoreWebView2WebResourceResponse response = null;

            _environment.CreateWebResourceResponse(content, statusCode, reasonPhrase, headers, ref response);

            WebView2WebResourceResponse wrappedResonse = new WebView2WebResourceResponse(response);

            return(wrappedResonse);
        }
コード例 #2
0
 public void SetResponse(WebView2WebResourceResponse response)
 {
     _args.Response = response.InternalWebView2WebResourceResponse;
 }
コード例 #3
0
 internal WebResourceRequestedEventArgs(ICoreWebView2WebResourceRequestedEventArgs args)
 {
     _args        = args;
     _webResponse = new WebView2WebResourceResponse(_args.Response);
 }