Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
        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);
        }
Esempio n. 5
0
        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);
        }
Esempio n. 6
0
        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);
        }
Esempio n. 7
0
 public void TestDomainLink()
 {
     Assert.AreEqual(_domain.Name, _links.get_Domain(_domain.ID).Name);
 }