public void DeleteGroup(string groupName) { Tree config = AMSHelper.GetUsersConfig(); AmsMailbox amsGroup = new AmsMailbox(groupName); if (amsGroup.Load(config)) { if (!amsGroup.Delete(config)) { throw new Exception("Couldn't delete specified mail group."); } } else { throw new Exception("Couldn't find specified mail group."); } }
public void DeleteAccount(string mailboxName) { Tree config = AMSHelper.GetUsersConfig(); AmsMailbox amsMailbox = new AmsMailbox(mailboxName); if (amsMailbox.Load(config)) { if (!amsMailbox.Delete(config)) { throw new Exception("Couldn't delete a specified account."); } } else { throw new Exception("Couldn't load account settings."); } }