System.Net.Configuration.DefaultProxySectionInternal.GetSection C# (CSharp) Method

GetSection() static private method

static private GetSection ( ) : DefaultProxySectionInternal
return DefaultProxySectionInternal
        static internal DefaultProxySectionInternal GetSection()
        {
            lock (DefaultProxySectionInternal.ClassSyncObject)
            {
                DefaultProxySection section = PrivilegedConfigurationManager.GetSection(ConfigurationStrings.DefaultProxySectionPath) as DefaultProxySection;
                if (section == null)
                    return null;

                try
                {
                    return new DefaultProxySectionInternal(section);
                }
                catch (Exception exception)
                {
                    if (NclUtilities.IsFatal(exception)) throw;

                    throw new ConfigurationErrorsException(SR.GetString(SR.net_config_proxy), exception);
                }
                catch
                {
                    throw new ConfigurationErrorsException(SR.GetString(SR.net_config_proxy), new Exception(SR.GetString(SR.net_nonClsCompliantException)));
                }
            }
        }