public void DeleteIPBan(IPBan ban) { Contract.Requires(ban != null); ban.Delete(); RemoveIPBan(ban); }
public IPBan CreateIPBan(IPAddress ip, string notes, DateTime?expiry) { Contract.Requires(ip != null); Contract.Ensures(Contract.Result <IPBan>() != null); var rec = new IPBanRecord(ip.GetAddressBytes()) { Notes = notes, Expiry = expiry, }; rec.Create(); var ban = new IPBan(rec); AddIPBan(ban); return(ban); }
public void RemoveIPBan(IPBan ban) { Contract.Requires(ban != null); _ipBans.Remove(ban); }
public void AddIPBan(IPBan ban) { Contract.Requires(ban != null); _ipBans.Add(ban); }