コード例 #1
0
 // Token: 0x06000F5A RID: 3930 RVA: 0x0003ECA9 File Offset: 0x0003CEA9
 public ConnectionSettings(IConnectionSettingsReadProvider provider, ProtocolSpecificConnectionSettings incomingSettings, SmtpConnectionSettings outgoingSettings)
 {
     if (provider == null)
     {
         throw new ArgumentNullException("provider", "The provider parameter cannot be null.");
     }
     this.Initialize(provider, incomingSettings, outgoingSettings);
 }
コード例 #2
0
        // Token: 0x06000F65 RID: 3941 RVA: 0x0003ED90 File Offset: 0x0003CF90
        private void Initialize(IConnectionSettingsReadProvider provider, ProtocolSpecificConnectionSettings incomingSettings, SmtpConnectionSettings outgoingSettings)
        {
            if (incomingSettings == null)
            {
                throw new ArgumentNullException("incomingSettings", "The incomingSettings parameter cannot be null.");
            }
            ConnectionSettingsType connectionType = incomingSettings.ConnectionType;

            if (connectionType <= ConnectionSettingsType.ExchangeActiveSync)
            {
                if (connectionType == ConnectionSettingsType.Office365 || connectionType == ConnectionSettingsType.ExchangeActiveSync)
                {
                    if (outgoingSettings != null)
                    {
                        throw new ArgumentException(string.Format(CultureInfo.InvariantCulture, "The outgoingSettings parameter is invalid (ConnectionType: {0}). It should be set to null for {1} settings.", new object[]
                        {
                            outgoingSettings.ConnectionType,
                            incomingSettings.ConnectionType
                        }));
                    }
                    goto IL_10B;
                }
            }
            else if (connectionType != ConnectionSettingsType.Imap && connectionType != ConnectionSettingsType.Pop)
            {
                if (connectionType == ConnectionSettingsType.Smtp)
                {
                    throw new ArgumentException(string.Format(CultureInfo.InvariantCulture, "The incomingSettings parameter cannot be {0}. That is an outgoing protocol.", new object[]
                    {
                        incomingSettings.ConnectionType
                    }));
                }
            }
            else
            {
                if (outgoingSettings == null)
                {
                    throw new ArgumentNullException(string.Format(CultureInfo.InvariantCulture, "The outgoingSettings parameter cannot be null for {0} settings. It must be Smtp.", new object[]
                    {
                        incomingSettings.ConnectionType
                    }));
                }
                goto IL_10B;
            }
            throw new NotSupportedException(string.Format(CultureInfo.InvariantCulture, "The incommingSettings argument has an unexpected ConnectionType: {0}.", new object[]
            {
                incomingSettings.ConnectionType
            }));
IL_10B:
            this.SourceId = ((provider == null) ? ConnectionSettings.UserSpecified : provider.SourceId);
            this.OutgoingConnectionSettings = outgoingSettings;
            this.IncomingConnectionSettings = incomingSettings;
        }
コード例 #3
0
 // Token: 0x06000F5B RID: 3931 RVA: 0x0003ECCD File Offset: 0x0003CECD
 public ConnectionSettings(ProtocolSpecificConnectionSettings incomingSettings, SmtpConnectionSettings outgoingSettings)
 {
     this.Initialize(null, incomingSettings, outgoingSettings);
 }