private void ListBlockedAttachments()
{
listBlockedAttachments.Items.Clear();
hMailServer.Settings settings = APICreator.Application.Settings;
hMailServer.AntiVirus antiVirusSettings = settings.AntiVirus;
hMailServer.BlockedAttachments attachments = antiVirusSettings.BlockedAttachments;
for (int i = 0; i < attachments.Count; i++)
{
hMailServer.BlockedAttachment attachment = attachments[i];
ListViewItem item = listBlockedAttachments.Items.Add(attachment.Wildcard);
item.SubItems.Add(attachment.Description);
item.Tag = attachment.ID;
Marshal.ReleaseComObject(attachment);
}
Marshal.ReleaseComObject(settings);
Marshal.ReleaseComObject(antiVirusSettings);
Marshal.ReleaseComObject(attachments);
}