hMailServer.Administrator.Dialogs.formExternalAccount.LoadAccountProperties C# (CSharp) Method

LoadAccountProperties() public method

public LoadAccountProperties ( hMailServer fetchAccount ) : void
fetchAccount hMailServer
return void
        public void LoadAccountProperties(hMailServer.FetchAccount fetchAccount)
        {
            _isLoading = true;

             _fetchAccount = fetchAccount;

             checkEnabled.Checked = fetchAccount.Enabled;
             textName.Text = fetchAccount.Name;
             textMinutesBetweenFetch.Number = fetchAccount.MinutesBetweenFetch;
             comboServerType.SelectedValue = fetchAccount.ServerType;
             textServer.Text = fetchAccount.ServerAddress;
             textPort.Number = fetchAccount.Port;
             textUsername.Text = fetchAccount.Username;
             checkUseSSL.Checked = fetchAccount.UseSSL;

             checkProcessMIMERecipients.Checked = fetchAccount.ProcessMIMERecipients;
             checkProcessMIMEDate.Checked = fetchAccount.ProcessMIMEDate;

             checkUseAntiSpam.Checked = fetchAccount.UseAntiSpam;
             checkUseAntiVirus.Checked = fetchAccount.UseAntiVirus;

             checkEnableRouteRecipients.Checked = fetchAccount.EnableRouteRecipients;

             if (fetchAccount.DaysToKeepMessages == -1)
            radioDeleteImmediately.Checked = true;
             else if (fetchAccount.DaysToKeepMessages == 0)
            radioNeverDeleteMessages.Checked = true;
             else
             {
            radioDeleteMessagesAfter.Checked = true;
            textDaysToKeepMessages.Number = fetchAccount.DaysToKeepMessages;
             }

             buttonDownloadNow.Enabled = true;

             _isLoading = false;

             EnableDisable();
        }

Usage Example

Exemplo n.º 1
0
        private void EditSelectedExternalAccount()
        {
            if (listFetchAccounts.SelectedItems.Count < 1)
                return;

            int id = Convert.ToInt32(listFetchAccounts.SelectedItems[0].Tag);

            hMailServer.FetchAccounts fetchAccounts = _representedAccount.FetchAccounts;
            hMailServer.FetchAccount fetchAccount = fetchAccounts.get_ItemByDBID(id);

            formExternalAccount externalAccountDialog = new formExternalAccount();

            externalAccountDialog.LoadAccountProperties(fetchAccount);
            if (externalAccountDialog.ShowDialog() == DialogResult.OK)
            {
                externalAccountDialog.SaveAccountProperties(fetchAccount);
                fetchAccount.Save();
            }

            ListExternalAccounts();

            Marshal.ReleaseComObject(fetchAccounts);
            Marshal.ReleaseComObject(fetchAccount);
        }