Exemplo n.º 1
0
        private void PopulateNntpServerDefinition(string nntpServerID)
        {
            if (nntpServerID != null && this.nntpServers.Contains(nntpServerID))
            {
                NntpServerDefinition sd = (NntpServerDefinition)this.nntpServers[nntpServerID];

                txtNewsAccountName.Text            = sd.Name;
                cboDefaultIdentities.Text          = sd.DefaultIdentity;
                chkConsiderServerOnRefresh.Checked = false;
                if (sd.PreventDownloadOnRefreshSpecified)
                {
                    chkConsiderServerOnRefresh.Checked = !sd.PreventDownloadOnRefresh;
                }

                txtNewsServerName.Text = sd.Server;
                string u, p;
                FeedSource.GetNntpServerCredentials(sd, out u, out p);
                chkUseAuthentication.Checked = false;
                txtServerAuthName.Enabled    = txtServerAuthPassword.Enabled = false;
                if (!string.IsNullOrEmpty(u))
                {
                    chkUseAuthentication.Checked = true;
                    txtServerAuthName.Enabled    = txtServerAuthPassword.Enabled = true;
                    txtServerAuthName.Text       = u;
                    txtServerAuthPassword.Text   = p;
                }
                else
                {
                    txtServerAuthName.Text = txtServerAuthPassword.Text = String.Empty;
                }


                txtServerPort.Text = String.Empty;
                if (sd.PortSpecified)
                {
                    txtServerPort.Text = sd.Port.ToString();
                }

                chkUseSSL.Checked = false;
                if (sd.UseSSLSpecified)
                {
                    chkUseSSL.Checked = sd.UseSSL;
                }

                trackBarServerTimeout.Value = 0;
                lblCurrentTimout.Text       = "0";
                if (sd.TimeoutSpecified)
                {
                    trackBarServerTimeout.Value = sd.Timeout;
                    lblCurrentTimout.Text       = sd.Timeout.ToString();
                }

                IList <string> groups = application.LoadNntpNewsGroups(this, sd, false);
                listOfGroups.Tag = null;
                this.PopulateNewsGroups(sd, groups, application.CurrentSubscriptions(sd));
            }
        }