// Token: 0x06000FAA RID: 4010 RVA: 0x0003FE30 File Offset: 0x0003E030
        private SmtpConnectionSettings BuildSmtpConnectionSettings(XElement settings)
        {
            Fqdn attributeValue  = GlobalConnectionSettingsProvider.GetAttributeValue <Fqdn>(settings, "out-serv", new Func <string, string, Fqdn>(GlobalConnectionSettingsProvider.ServerAttributeToFqdn));
            int  attributeValue2 = GlobalConnectionSettingsProvider.GetAttributeValue <int>(settings, "out-port", new Func <string, string, int>(GlobalConnectionSettingsProvider.ServerAttributeToInteger));

            return(new SmtpConnectionSettings(attributeValue, attributeValue2));
        }
        // Token: 0x06000FA9 RID: 4009 RVA: 0x0003FDC0 File Offset: 0x0003DFC0
        private PopConnectionSettings BuildPopConnectionSettings(XElement settings)
        {
            Fqdn attributeValue  = GlobalConnectionSettingsProvider.GetAttributeValue <Fqdn>(settings, "in-serv", new Func <string, string, Fqdn>(GlobalConnectionSettingsProvider.ServerAttributeToFqdn));
            int  attributeValue2 = GlobalConnectionSettingsProvider.GetAttributeValue <int>(settings, "in-port", new Func <string, string, int>(GlobalConnectionSettingsProvider.ServerAttributeToInteger));
            Pop3SecurityMechanism attributeValue3 = GlobalConnectionSettingsProvider.GetAttributeValue <Pop3SecurityMechanism>(settings, "in-ssl", delegate(string attrName, string val)
            {
                if (!val.Equals("1", StringComparison.Ordinal))
                {
                    return(Pop3SecurityMechanism.None);
                }
                return(Pop3SecurityMechanism.Ssl);
            });

            return(new PopConnectionSettings(attributeValue, attributeValue2, Pop3AuthenticationMechanism.Basic, attributeValue3));
        }
        public static ConnectionSettingsManager GetInstanceForModernOutlook(ILogAdapter logAdapter)
        {
            if (logAdapter == null)
            {
                throw new ArgumentNullException("logAdapter", "The logAdapter parameter cannot be null.");
            }
            logAdapter.RegisterLogMetaData("ConnectionSettingsDiscovery", typeof(ConnectionSettingsDiscoveryMetadata));
            GlobalConnectionSettingsProvider globalConnectionSettingsProvider = new GlobalConnectionSettingsProvider(logAdapter);

            return(new ConnectionSettingsManager(new IConnectionSettingsWriteProvider[]
            {
                globalConnectionSettingsProvider
            }, new IConnectionSettingsReadProvider[]
            {
                new O365ConnectionSettingsProvider(logAdapter),
                globalConnectionSettingsProvider
            }));
        }
        // Token: 0x06000FA7 RID: 4007 RVA: 0x0003FC94 File Offset: 0x0003DE94
        private ConnectionSettings ProcessSettingsXml(XElement settings)
        {
            if (settings == null)
            {
                throw new ArgumentNullException("settings", "The settings argument cannot be null.");
            }
            ConnectionSettingsType attributeValue         = GlobalConnectionSettingsProvider.GetAttributeValue <ConnectionSettingsType>(settings, "transport", new Func <string, string, ConnectionSettingsType>(GlobalConnectionSettingsProvider.TransportAttributeToSettingsType));
            ConnectionSettingsType connectionSettingsType = attributeValue;

            if (connectionSettingsType == ConnectionSettingsType.Imap)
            {
                return(new ConnectionSettings(this, this.BuildImapConnectionSettings(settings), this.BuildSmtpConnectionSettings(settings)));
            }
            if (connectionSettingsType != ConnectionSettingsType.Pop)
            {
                throw new XmlException(string.Format(CultureInfo.InvariantCulture, "Invalid response received from ESS service: The attribute [transport] has an unexpected value: {0}.", new object[]
                {
                    attributeValue
                }));
            }
            return(new ConnectionSettings(this, this.BuildPopConnectionSettings(settings), this.BuildSmtpConnectionSettings(settings)));
        }