public bool SaveData() { bool newObject = false; if (_representedObject == null) { hMailServer.Domain domain = APICreator.GetDomain(_domainID); hMailServer.DistributionLists lists = domain.DistributionLists; _representedObject = lists.Add(); newObject = true; Marshal.ReleaseComObject(lists); Marshal.ReleaseComObject(domain); } _representedObject.Address = textAddress.Text; _representedObject.Active = checkEnabled.Checked; if (radioModePublic.Checked) { _representedObject.Mode = eDistributionListMode.eLMPublic; } if (radioModeMembership.Checked) { _representedObject.Mode = eDistributionListMode.eLMMembership; } if (optModeAnnouncements.Checked) { _representedObject.Mode = eDistributionListMode.eLMAnnouncement; } _representedObject.RequireSenderAddress = textRequireAddress.Text; _representedObject.RequireSMTPAuth = checkRequireSMTPAuthentication.Checked; _representedObject.Save(); // Refresh the node in the tree if the name has changed. IMainForm mainForm = Instances.MainForm; mainForm.RefreshCurrentNode(textAddress.Text); // Set the object to clean. DirtyChecker.SetClean(this); if (newObject) { SearchNodeText crit = new SearchNodeText(_representedObject.Address); mainForm.SelectNode(crit); } EnableDisableTabs(); return(true); }
protected override void DeleteItems(List <ListViewItem> items) { hMailServer.Domain domain = APICreator.GetDomain(_domainID); hMailServer.DistributionLists lists = domain.DistributionLists; foreach (var item in items) { int listID = Convert.ToInt32(item.Tag); lists.DeleteByDBID(listID); } Marshal.ReleaseComObject(lists); Marshal.ReleaseComObject(domain); }
internal DistributionLists(hMailServer.DistributionLists o) { _object = o; }
internal DistributionLists(hMailServer.DistributionLists o) { _object = o; }