SaveAccountProperties() публичный Метод

public SaveAccountProperties ( hMailServer fetchAccount ) : void
fetchAccount hMailServer
Результат void
Пример #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);
        }
Пример #2
0
        private void buttonAddExternalAccount_Click(object sender, EventArgs e)
        {
            formExternalAccount externalAccountDialog = new formExternalAccount();

            if (externalAccountDialog.ShowDialog() == DialogResult.OK)
            {
                hMailServer.FetchAccounts fetchAccounts = _representedAccount.FetchAccounts;
                hMailServer.FetchAccount fetchAccount = _representedAccount.FetchAccounts.Add();
                Marshal.ReleaseComObject(fetchAccounts);

                externalAccountDialog.SaveAccountProperties(fetchAccount);
                fetchAccount.Save();

                Marshal.ReleaseComObject(fetchAccount);

                ListExternalAccounts();
            }
        }