Repository: dotnet/runtime
File: src/libraries/System.Net.WebProxy/src/System/Net/WebProxy.cs (C#)

Code before:
namespace System.Net
{
    /// <summary>
    /// Contains HTTP proxy settings for the <see cref="T:System.Net.Http.HttpClient" /> class.
    /// </summary>
    /// <remarks>
    /// <para>
    /// The <see cref="WebProxy"/> class contains the proxy settings that <see cref="T:System.Net.Http.HttpClient"/> instances use to determine whether a Web proxy is used to send requests.
    /// Global Web proxy settings can be specified in machine and application configuration files, and applications can use instances of the <see cref="WebProxy"/> class to customize Web proxy use.
    /// The <see cref="WebProxy"/> class is the base implementation of the <see cref="IWebProxy"/> interface.
    /// </para>
    /// <para>
    /// To obtain instances of the Web proxy class, you can use any of the following methods:
    /// </para>
    /// <list type="bullet">
    /// <item>The <see cref="WebProxy()"/> constructor.</item>
    /// <item>The <see cref="GetDefaultProxy"/> method.</item>
    /// <item>The <see cref="T:System.Net.GlobalProxySelection.Select"/> method.</item>
    /// </list>
    /// <para>
    /// These methods each supply a <see cref="WebProxy"/> instance that you can further customize; the difference between them is how the instance is initialized before it is returned to your application.
    /// The <see cref="WebProxy()"/> constructor returns an instance of the <see cref="WebProxy"/> class with the <see cref="Address"/> property set to <see langword="null"/>.
    /// When a request uses a <see cref="WebProxy"/> instance in this state, no proxy is used to send the request.
    /// </para>
    /// <para>
    /// The <see cref="GetDefaultProxy"/> method returns an instance of the <see cref="WebProxy"/> class with the <see cref="Address"/>, <see cref="BypassProxyOnLocal"/>, and <see cref="BypassList"/> properties set to the values used by the local computer.
    /// </para>
    /// <para>
    /// The <see cref="T:System.Net.GlobalProxySelection.Select"/> method returns an instance of the <see cref="WebProxy"/> class with its properties set according to a combination of Internet and configuration file settings.
    /// </para>
    /// <para>
    /// The <see cref="WebProxy"/> class supports automatic detection and execution of proxy configuration scripts. This feature is also known as Web Proxy Auto-Discovery (WPAD).
    /// When using automatic proxy configuration, a configuration script, typically named Wpad.dat, must be located, downloaded, compiled, and run.
    /// If these operations are successful, the script returns the proxies that can be used for a request.
    /// </para>
    /// </remarks>
    public partial class WebProxy : IWebProxy, ISerializable
    {
        private ChangeTrackingArrayList? _bypassList;
        private Regex[]? _regexBypassList;

        /// <summary>
        /// Initializes an empty instance of the <see cref="WebProxy" /> class.
        /// </summary>
        /// <remarks>
        /// <para>
        /// The parameterless constructor initializes an empty instance of the <see cref="WebProxy"/> class with the <see cref="Address"/> property set to <see langword="null"/>.
        /// </para>
        /// <para>
        /// When the <see cref="Address"/> property is <see langword="null"/>, the <see cref="IsBypassed"/> method returns <see langword="true"/> and the <see cref="GetProxy"/> method returns the destination address.
        /// </para>

Review comment (suggestion):
```suggestion
    /// In .NET Framework, the <see cref="GetDefaultProxy"/> method returns an instance of the <see cref="WebProxy"/> class with the <see cref="Address"/>, <see cref="BypassProxyOnLocal"/>, and <see cref="BypassList"/> properties set to the values used by the local computer.
    /// In modern .NET, the <see cref="GetDefaultProxy"/> method is obsolete. Calling it throws a <see cref="PlatformNotSupportedException"/>; use application configuration or construct a <see cref="WebProxy"/> instance directly instead.
```

Code after:
namespace System.Net
{
    /// <summary>
    /// Contains HTTP proxy settings for the <see cref="T:System.Net.Http.HttpClient" /> class.
    /// </summary>
    /// <remarks>
    /// The <see cref="WebProxy"/> class contains the proxy settings that <see cref="T:System.Net.Http.HttpClient"/> instances use to determine whether a Web proxy is used to send requests.
    /// The <see cref="WebProxy"/> class is the base implementation of the <see cref="IWebProxy"/> interface.
    /// </remarks>
    public partial class WebProxy : IWebProxy, ISerializable
    {
        private ChangeTrackingArrayList? _bypassList;
        private Regex[]? _regexBypassList;

        /// <summary>
        /// Initializes an empty instance of the <see cref="WebProxy" /> class.
        /// </summary>
        /// <remarks>
        /// <para>
        /// The parameterless constructor initializes an empty instance of the <see cref="WebProxy"/> class with the <see cref="Address"/> property set to <see langword="null"/>.
        /// </para>
        /// <para>
        /// When the <see cref="Address"/> property is <see langword="null"/>, the <see cref="IsBypassed"/> method returns <see langword="true"/> and the <see cref="GetProxy"/> method returns the destination address.
        /// </para>
        /// </remarks>
        public WebProxy() : this((Uri?)null, false, null, null) { }

        /// <summary>
        /// Initializes a new instance of the <see cref="WebProxy" /> class from the specified <see cref="Uri" /> instance.
        /// </summary>
        /// <param name="Address">The address of the proxy server.</param>
        public WebProxy(Uri? Address) : this(Address, false, null, null) { }

        /// <summary>
        /// Initializes a new instance of the <see cref="WebProxy" /> class with the <see cref="Uri" /> instance and bypass setting.
        /// </summary>
        /// <param name="Address">A <see cref="Uri" /> instance that contains the address of the proxy server.</param>
        /// <param name="BypassOnLocal"><see langword="true" /> to bypass the proxy for local addresses; otherwise, <see langword="false" />.</param>
        public WebProxy(Uri? Address, bool BypassOnLocal) : this(Address, BypassOnLocal, null, null) { }

        /// <summary>
        /// Initializes a new instance of the <see cref="WebProxy" /> class with the specified <see cref="Uri" /> instance, bypass setting, and list of URIs to bypass.
        /// </summary>
        /// <param name="Address">A <see cref="Uri" /> instance that contains the address of the proxy server.</param>
        /// <param name="BypassOnLocal"><see langword="true" /> to bypass the proxy for local addresses; otherwise, <see langword="false" />.</param>
        /// <param name="BypassList">An array of regular expression strings that contains the URIs of the servers to bypass.</param>
        public WebProxy(Uri? Address, bool BypassOnLocal, [StringSyntax(StringSyntaxAttribute.Regex, RegexOptions.IgnoreCase | RegexOptions.CultureInvariant)] string[]? BypassList) : this(Address, BypassOnLocal, BypassList, null) { }

        /// <summary>
        /// Initializes a new instance of the <see cref="WebProxy" /> class with the specified <see cref="Uri" /> instance, bypass setting, list of URIs to bypass, and credentials.
        /// </summary>