예제 #1
0
 private void btnGateway_Click(object sender, EventArgs e)
 {
     GatewaySetting setting = new GatewaySetting {
         GatewayInfo = this.gsc
     };
     if (setting.ShowDialog() == DialogResult.OK)
     {
         this.gsc = setting.GatewayInfo;
     }
     setting.Close();
     setting.Dispose();
 }
예제 #2
0
        private void LoadServer()
        {
            if (this.Protocol != ProtocolType.Mail)
            {
                this.pnlServer.Visible = true;
                this.pnlMail.Visible = false;
                this.cmbServerConnect.Items.Clear();
                this.cmbServerConnect.Items.AddRange(systemEnvironment.InteractiveInfo.GetDisplayNames().ToArray());
                if (this.cmbServerConnect.Items.Count > 0)
                {
                    this.cmbServerConnect.SelectedIndex = 0;
                }
                int num2 = 0;
                foreach (string str2 in systemEnvironment.InteractiveInfo.GetNames())
                {
                    if (str2 == userEnvironment.InteractiveInfo.ServerConnect)
                    {
                        if (this.cmbServerConnect.Items.Count > num2)
                        {
                            this.cmbServerConnect.SelectedIndex = num2;
                        }
                        break;
                    }
                    num2++;
                }
            }
            else
            {
                this.pnlServer.Visible = false;
                this.pnlMail.Visible = true;
                this.pnlMail.Location = new Point(8, 0x11);
                this.cmbServerConnectM.Items.Clear();
                this.cmbServerConnectM.Items.AddRange(systemEnvironment.MailInfo.GetDisplayNames().ToArray());
                if (this.cmbServerConnectM.Items.Count > 0)
                {
                    this.cmbServerConnectM.SelectedIndex = 0;
                }
                int num = 0;
                foreach (string str in systemEnvironment.MailInfo.GetNames())
                {
                    if (str == userEnvironment.MailInfo.ServerConnect)
                    {
                        if (this.cmbServerConnectM.Items.Count > num)
                        {
                            this.cmbServerConnectM.SelectedIndex = num;
                        }
                        break;
                    }
                    num++;
                }
                this.ckbUseGateway.Checked = userEnvironment.MailInfo.UseGateway;
                this.btnGateway.Enabled = this.ckbUseGateway.Checked;
                this.gsc = new GatewaySettingClass();
                this.gsc.GatewaySMTPServerName = userEnvironment.MailInfo.GatewaySMTPServerName;
                this.gsc.GatewaySMTPServerPort = userEnvironment.MailInfo.GatewaySMTPServerPort;
                this.gsc.GatewayPOPServerName = userEnvironment.MailInfo.GatewayPOPServerName;
                this.gsc.GatewayPOPServerPort = userEnvironment.MailInfo.GatewayPOPServerPort;
                this.gsc.GatewaySMTPDomainName = userEnvironment.MailInfo.GatewaySMTPDomainName;
                this.gsc.GatewayPOPDomainName = userEnvironment.MailInfo.GatewayPOPDomainName;
                this.gsc.GatewayMailBox = userEnvironment.MailInfo.GatewayMailBox;
                this.gsc.GatewayAddDomainName = userEnvironment.MailInfo.GatewayAddDomainName;
                this.ckbUseProxyM.Checked = userEnvironment.HttpOption.UseProxy;
                this.txbProxyNameM.Text = userEnvironment.HttpOption.ProxyName;
                this.txbProxyPortM.Text = userEnvironment.HttpOption.ProxyPort.ToString();
                this.ckbUseProxyAccountM.Checked = userEnvironment.HttpOption.UseProxyAccount;
                this.txbProxyAccountM.Text = userEnvironment.HttpOption.ProxyAccount;
                this.txbProxyPasswordM.Text = userEnvironment.HttpOption.ProxyPassword;
                this.ckbTraceOutputM.Checked = userEnvironment.MailInfo.TraceOutput;
                this.txbTraceOutput1M.Text = systemEnvironment.MailInfo.TraceFileName;
                this.txbTraceOutput1M.Enabled = this.ckbTraceOutputM.Checked;
                this.txbTraceOutput2M.Text = systemEnvironment.BatchdocInfo.TraceFileName;
                this.txbTraceOutput2M.Enabled = this.ckbTraceOutputM.Checked;
                this.ckbUseAutoSndRcvTm.Checked = userEnvironment.MailInfo.AutoMode;
                this.nudAutoSndRcvTm.Enabled = this.ckbUseAutoSndRcvTm.Checked;
                if (userEnvironment.MailInfo.AutoTm < this.nudAutoSndRcvTm.Minimum)
                {
                    this.nudAutoSndRcvTm.Value = this.nudAutoSndRcvTm.Minimum;
                }
                else
                {
                    this.nudAutoSndRcvTm.Value = userEnvironment.MailInfo.AutoTm;
                }
                switch (userEnvironment.MailInfo.AutoTmKind)
                {
                    case 2:
                        this.rdbAutoTmKindS.Checked = true;
                        break;

                    case 3:
                        this.rdbAutoTmKindR.Checked = true;
                        break;

                    default:
                        this.rdbAutoTmKindSR.Checked = true;
                        break;
                }
                this.nudMaxRetreiveCnt.Value = userEnvironment.MailInfo.MaxRetreiveCnt;
                this.ckbServer_CheckedChanged(this.ckbUseProxyM, new EventArgs());
                this.ckbServer_CheckedChanged(this.ckbUseProxyAccountM, new EventArgs());
                this.ckbServer_CheckedChanged(this.ckbUseAutoSndRcvTm, new EventArgs());
                this.ckbServer_CheckedChanged(this.ckbTraceOutputM, new EventArgs());
                this.ckbServer_CheckedChanged(this.ckbUseGateway, new EventArgs());
                return;
            }
            this.ckbUseProxy.Checked = userEnvironment.HttpOption.UseProxy;
            this.txbProxyName.Text = userEnvironment.HttpOption.ProxyName;
            this.txbProxyPort.Text = userEnvironment.HttpOption.ProxyPort.ToString();
            this.ckbUseProxyAccount.Checked = userEnvironment.HttpOption.UseProxyAccount;
            this.txbProxyAccount.Text = userEnvironment.HttpOption.ProxyAccount;
            this.txbProxyPassword.Text = userEnvironment.HttpOption.ProxyPassword;
            this.ckbTraceOutput.Checked = userEnvironment.InteractiveInfo.TraceOutput;
            this.txbTraceOutput1.Text = systemEnvironment.InteractiveInfo.TraceFileName;
            this.txbTraceOutput1.Enabled = this.ckbTraceOutput.Checked;
            this.txbTraceOutput2.Text = systemEnvironment.BatchdocInfo.TraceFileName;
            this.txbTraceOutput2.Enabled = this.ckbTraceOutput.Checked;
            this.ckbAutoSendRecvMode.Checked = userEnvironment.InteractiveInfo.AutoSendRecvMode;
            this.nudAutoSendRecvTm.Enabled = this.ckbAutoSendRecvMode.Checked;
            if (userEnvironment.InteractiveInfo.AutoSendRecvTm < this.nudAutoSendRecvTm.Minimum)
            {
                this.nudAutoSendRecvTm.Value = this.nudAutoSendRecvTm.Minimum;
            }
            else
            {
                this.nudAutoSendRecvTm.Value = userEnvironment.InteractiveInfo.AutoSendRecvTm;
            }
            this.ckbJobConnect.Checked = userEnvironment.InteractiveInfo.JobConnect;
            this.gpbCertificate.Enabled = false;
            this.txbIssuerName.Clear();
            this.txbCertificateDate.Clear();
            this.ckbServer_CheckedChanged(this.ckbUseProxy, new EventArgs());
            this.ckbServer_CheckedChanged(this.ckbUseProxyAccount, new EventArgs());
            this.ckbServer_CheckedChanged(this.ckbTraceOutput, new EventArgs());
            this.ckbServer_CheckedChanged(this.ckbAutoSendRecvMode, new EventArgs());
        }