コード例 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="WebViewControlProcess"/> class with the specified <paramref name="processOptions"/>.
 /// </summary>
 /// <param name="processOptions">The process options.</param>
 public WebViewControlProcess(WebViewControlProcessOptions processOptions)
     : this(new Windows.Web.UI.Interop.WebViewControlProcess(processOptions.ToWinRtWebViewControlProcessOptions()))
 {
 }
コード例 #2
0
        public static Windows.Web.UI.Interop.WebViewControlProcessOptions ToWinRtWebViewControlProcessOptions(WebViewControlProcessOptions options)
        {
            var retval = new Windows.Web.UI.Interop.WebViewControlProcessOptions();

            if (!string.IsNullOrEmpty(options?.EnterpriseId) && !StringComparer.InvariantCulture.Equals(retval.EnterpriseId, options?.EnterpriseId))
            {
                retval.EnterpriseId = options.EnterpriseId;
            }

            if (ApiInformation.IsPropertyPresent(
                    "Windows.Web.UI.Interop.WebViewControlProcessOptions",
                    "Partition"))
            {
                if (!string.IsNullOrEmpty(options?.Partition))
                {
                    retval.Partition = options.Partition;
                }
            }

            retval.PrivateNetworkClientServerCapability = (Windows.Web.UI.Interop.WebViewControlProcessCapabilityState)options?.PrivateNetworkClientServerCapability;

            if (ApiInformation.IsPropertyPresent(
                    "Windows.Web.UI.Interop.WebViewControlProcessOptions",
                    "UserAgent"))
            {
                if (!string.IsNullOrEmpty(options?.UserAgent))
                {
                    retval.UserAgent = options.UserAgent;
                }
            }

            return(retval);
        }
コード例 #3
0
        public static windows.Web.UI.Interop.WebViewControlProcessOptions ToWinRtWebViewControlProcessOptions(WebViewControlProcessOptions options)
        {
            var retval = new windows.Web.UI.Interop.WebViewControlProcessOptions();

            if (!string.IsNullOrEmpty(options?.EnterpriseId) && !StringComparer.InvariantCulture.Equals(retval.EnterpriseId, options?.EnterpriseId))
            {
                retval.EnterpriseId = options.EnterpriseId;
            }

            retval.PrivateNetworkClientServerCapability = (windows.Web.UI.Interop.WebViewControlProcessCapabilityState)options?.PrivateNetworkClientServerCapability;

            return(retval);
        }
コード例 #4
0
        public static Windows.Web.UI.Interop.WebViewControlProcessOptions ToWinRtWebViewControlProcessOptions(WebViewControlProcessOptions options)
        {
            const string winRtType = "Windows.Web.UI.Interop.WebViewControlProcessOptions";

            var retval = new Windows.Web.UI.Interop.WebViewControlProcessOptions();

            if (!string.IsNullOrEmpty(options?.EnterpriseId) && !StringComparer.InvariantCulture.Equals(retval.EnterpriseId, options?.EnterpriseId))
            {
                retval.EnterpriseId = options.EnterpriseId;
            }

            retval.PrivateNetworkClientServerCapability = (Windows.Web.UI.Interop.WebViewControlProcessCapabilityState)options?.PrivateNetworkClientServerCapability;

            ApiInformationExtensions.ExecuteIfPropertyPresent(
                winRtType,
                "Partition",
                () =>
            {
                if (!string.IsNullOrEmpty(options?.Partition))
                {
                    retval.Partition = options.Partition;
                }
            });

            ApiInformationExtensions.ExecuteIfPropertyPresent(
                winRtType,
                "UserAgent",
                () =>
            {
                if (!string.IsNullOrEmpty(options?.UserAgent))
                {
                    retval.UserAgent = options.UserAgent;
                }
            });

            return(retval);
        }