hMailServer.Administrator.ucAccounts.LoadList C# (CSharp) Method

LoadList() protected method

protected LoadList ( ) : void
return void
        protected override void LoadList()
        {
            listAccounts.Items.Clear();

            hMailServer.Domain domain = APICreator.GetDomain(_domainID);

            hMailServer.Accounts accounts = domain.Accounts;

            for (int i = 0; i < accounts.Count; i++)
            {
                hMailServer.Account account = accounts[i];
                ListViewItem item = listAccounts.Items.Add(account.Address);
                item.SubItems.Add(EnumStrings.GetYesNoString(account.Active));
                item.Tag = account.ID;

                Marshal.ReleaseComObject(account);
            }

            Marshal.ReleaseComObject(domain);
            Marshal.ReleaseComObject(accounts);
        }