private void EditSelectedItem() { if (listWhiteAddresses.SelectedItems.Count != 1) { return; } int id = Convert.ToInt32(listWhiteAddresses.SelectedItems[0].Tag); hMailServer.WhiteListAddresses addresses = GetWhiteListAddresses(); hMailServer.WhiteListAddress address = addresses.get_ItemByDBID(id); formWhiteListAddress whiteDlg = new formWhiteListAddress(); whiteDlg.LoadProperties(address); if (whiteDlg.ShowDialog() == DialogResult.OK) { whiteDlg.SaveProperties(address); address.Save(); ListItems(); } Marshal.ReleaseComObject(address); Marshal.ReleaseComObject(addresses); }
private void buttonAddWhiteAddress_Click(object sender, EventArgs e) { formWhiteListAddress whiteDlg = new formWhiteListAddress(); if (whiteDlg.ShowDialog() == DialogResult.OK) { hMailServer.AntiSpam antiSpam = APICreator.AntiSpamSettings; hMailServer.WhiteListAddresses addresses = antiSpam.WhiteListAddresses; hMailServer.WhiteListAddress address = addresses.Add(); whiteDlg.SaveProperties(address); address.Save(); Marshal.ReleaseComObject(antiSpam); Marshal.ReleaseComObject(addresses); Marshal.ReleaseComObject(address); ListItems(); } }
private void buttonAddWhiteAddress_Click(object sender, EventArgs e) { formWhiteListAddress whiteDlg = new formWhiteListAddress(); if (whiteDlg.ShowDialog() == DialogResult.OK) { hMailServer.AntiSpam antiSpam = APICreator.AntiSpamSettings; hMailServer.WhiteListAddresses addresses = antiSpam.WhiteListAddresses; hMailServer.WhiteListAddress address = addresses.Add(); whiteDlg.SaveProperties(address); address.Save(); Marshal.ReleaseComObject(antiSpam); Marshal.ReleaseComObject(addresses); Marshal.ReleaseComObject(address); ListItems(); } }
private void EditSelectedItem() { if (listWhiteAddresses.SelectedItems.Count != 1) return; int id = Convert.ToInt32(listWhiteAddresses.SelectedItems[0].Tag); hMailServer.WhiteListAddresses addresses = GetWhiteListAddresses(); hMailServer.WhiteListAddress address = addresses.get_ItemByDBID(id); formWhiteListAddress whiteDlg = new formWhiteListAddress(); whiteDlg.LoadProperties(address); if (whiteDlg.ShowDialog() == DialogResult.OK) { whiteDlg.SaveProperties(address); address.Save(); ListItems(); } Marshal.ReleaseComObject(address); Marshal.ReleaseComObject(addresses); }