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

LoadList() protected method

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

            hMailServer.Application app = APICreator.Application;
            hMailServer.Settings settings = app.Settings;
            hMailServer.Routes routes = settings.Routes;
            for (int i = 0; i < routes.Count; i++)
            {
                hMailServer.Route route = routes[i];

                ListViewItem item = listObjects.Items.Add(route.DomainName);
                item.Tag = route.ID;

                Marshal.ReleaseComObject(route);
            }

            Marshal.ReleaseComObject(routes);
            Marshal.ReleaseComObject(settings);
        }