public void OnDeleteObject(object sender, EventArgs args) { if (Utility.AskDeleteItem(_routeName)) { hMailServer.Routes routes = APICreator.Routes; routes.DeleteByDBID(_routeID); Instances.MainForm.RefreshParentNode(); } }
protected override void DeleteItems(List <ListViewItem> items) { hMailServer.Routes routes = APICreator.Routes; foreach (ListViewItem item in items) { int id = Convert.ToInt32(item.Tag); routes.DeleteByDBID(id); } Marshal.ReleaseComObject(routes); }