protected override void LoadList() { listAliases.Items.Clear(); hMailServer.Links links = APICreator.Links; hMailServer.Domain domain = links.get_Domain(_domainID); Marshal.ReleaseComObject(links); hMailServer.Aliases aliases = domain.Aliases; Marshal.ReleaseComObject(domain); for (int i = 0; i < aliases.Count; i++) { hMailServer.Alias alias = aliases[i]; ListViewItem item = listAliases.Items.Add(alias.Name); item.SubItems.Add(alias.Value); item.SubItems.Add(EnumStrings.GetYesNoString(alias.Active)); item.Tag = alias.ID; Marshal.ReleaseComObject(alias); } Marshal.ReleaseComObject(aliases); }
public ucDistributionList(int domainID, int listID) { InitializeComponent(); _domainID = domainID; hMailServer.Links links = APICreator.Links; hMailServer.Domain domain = links.get_Domain(_domainID); if (listID > 0) { representedObject = links.get_DistributionList(listID); Marshal.ReleaseComObject(links); } textAddress.Text = "@" + domain.Name; Marshal.ReleaseComObject(domain); EnableDisable(); DirtyChecker.SubscribeToChange(this, OnContentChanged); new TabOrderManager(this).SetTabOrder(TabOrderManager.TabScheme.AcrossFirst); }
protected override void LoadList() { listDistributionLists.Items.Clear(); hMailServer.Links links = APICreator.Links; hMailServer.Domain domain = links.get_Domain(_domainID); hMailServer.DistributionLists lists = domain.DistributionLists; for (int i = 0; i < lists.Count; i++) { hMailServer.DistributionList list = lists[i]; ListViewItem item = listDistributionLists.Items.Add(list.Address); item.SubItems.Add(EnumStrings.GetYesNoString(list.Active)); item.Tag = list.ID; Marshal.ReleaseComObject(list); } Marshal.ReleaseComObject(lists); Marshal.ReleaseComObject(domain); Marshal.ReleaseComObject(links); }
public ucAccount(int domainID, int accountID) { InitializeComponent(); _domainID = domainID; hMailServer.Links links = APICreator.Links; hMailServer.Domain domain = links.get_Domain(_domainID); if (accountID > 0) { _representedAccount = links.get_Account(accountID); } textAddress.Text = "@" + domain.Name; Marshal.ReleaseComObject(domain); Marshal.ReleaseComObject(links); comboAdministrationLevel.AddItem(InternalNames.GetAdministrationLevelName(eAdminLevel.hAdminLevelNormal), eAdminLevel.hAdminLevelNormal); comboAdministrationLevel.AddItem(InternalNames.GetAdministrationLevelName(eAdminLevel.hAdminLevelDomainAdmin), eAdminLevel.hAdminLevelDomainAdmin); comboAdministrationLevel.AddItem(InternalNames.GetAdministrationLevelName(eAdminLevel.hAdminLevelServerAdmin), eAdminLevel.hAdminLevelServerAdmin); comboAdministrationLevel.SelectedIndex = 0; dateVacationMessageExpiresDate.Value = DateTime.Now; DirtyChecker.SubscribeToChange(this, OnContentChanged); new TabOrderManager(this).SetTabOrder(TabOrderManager.TabScheme.AcrossFirst); }
public static hMailServer.Domain GetDomain(int domainID) { hMailServer.Links links = APICreator.Application.Links; hMailServer.Domain domain = links.get_Domain(domainID); Marshal.ReleaseComObject(links); return(domain); }
protected override void DeleteItems(List <ListViewItem> items) { hMailServer.Links links = APICreator.Links; hMailServer.Domain domain = links.get_Domain(_domainID); Marshal.ReleaseComObject(links); hMailServer.Aliases aliases = domain.Aliases; foreach (ListViewItem item in items) { int aliasID = Convert.ToInt32(item.Tag); aliases.DeleteByDBID(aliasID); } Marshal.ReleaseComObject(domain); Marshal.ReleaseComObject(aliases); }
public void TestDomainLink() { Assert.AreEqual(_domain.Name, _links.get_Domain(_domain.ID).Name); }