Ejemplo n.º 1
0
        public void TestAccountLink()
        {
            hMailServer.Account account =
                SingletonProvider <Utilities> .Instance.AddAccount(_domain, "test", "test");

            Assert.AreEqual(account.Address, _links.get_Account(account.ID).Address);
        }
Ejemplo n.º 2
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);
        }
Ejemplo n.º 3
0
        public void OnDeleteAccount(object sender, EventArgs args)
        {
            // Delete the domain.
            hMailServer.Links   links   = APICreator.Links;
            hMailServer.Account account = links.get_Account(_accountID);

            if (Utility.AskDeleteItem(account.Address))
            {
                account.Delete();

                Marshal.ReleaseComObject(links);
                Marshal.ReleaseComObject(account);

                Instances.MainForm.RefreshParentNode();
            }
        }