public Configuration(PopConnectionSettings InPop, SmtpConnectionSettings InSmtp)
        {
            InitializeComponent();

            this.InPopSrettings = InPop;
            this.InSmtpSettings = InSmtp;

            TempPopSettings  = new PopConnectionSettings();
            TempSmtpSettings = new SmtpConnectionSettings();
            TempPopSettings.CloneFrom(InPop);
            TempSmtpSettings.CloneFrom(InSmtp);

            InPopHostname.Text  = TempPopSettings.Hostname;
            InPopPort.Text      = TempPopSettings.Port.ToString();
            InPopUsername.Text  = TempPopSettings.UserLogin;
            InPopPassword.Text  = TempPopSettings.UserPassword;
            InPopRefrate.Text   = TempPopSettings.RefreshRateSeconds.ToString();
            CheckPopSsl.Checked = TempPopSettings.UseSsl;

            InSmtpHostname.Text  = TempSmtpSettings.Hostname;
            InSmtpPort.Text      = TempSmtpSettings.Port.ToString();
            InSmtpLogin.Text     = TempSmtpSettings.UserLogin;
            InSmtpPassword.Text  = TempSmtpSettings.UserPassword;
            CheckSmtpSsl.Checked = TempSmtpSettings.UseSsl;
        }
 public void PushNewConfig(SmtpConnectionSettings NewConfig)
 {
     if (Connection.IsConnected() || ServerThread != null)
     {
         throw new Exception("cannot_change_config_at_service_runtime");
     }
     CurrentConfig = NewConfig;
 }
Beispiel #3
0
        private void SetupConfig()
        {
            PopConfig = new PopConnectionSettings();
            if (!PopConfig.TryReadFromFile(ConfigFilenamePop))
            {
                MessageBox.Show("POP3 config file could not be parsed (either missing or corrupted).\nPlease fill your information in the config menu.");
            }

            SmtpConfig = new SmtpConnectionSettings();
            if (!SmtpConfig.TryReadFromFile(ConfigFilenameSmtp))
            {
                MessageBox.Show("SMTP config file could not be parsed (either missing or corrupted).\nPlease fill your information in the config menu.");
            }
        }
 public void SetupConfig(SmtpConnectionSettings InConfig)
 {
     SmtpConfig = new SmtpConnectionSettings();
     SmtpConfig.CloneFrom(InConfig);
 }