public void DeleteIPRangeBan(IPRangeBan ban) { Contract.Requires(ban != null); ban.Delete(); RemoveIPRangeBan(ban); }
public IPRangeBan CreateIPRangeBan(IPAddressRange range, string notes, DateTime?expiry) { Contract.Requires(range != null); Contract.Ensures(Contract.Result <IPRangeBan>() != null); var rec = new IPRangeBanRecord(range.LowerBoundary.GetAddressBytes(), range.UpperBoundary.GetAddressBytes()) { Notes = notes, Expiry = expiry, }; rec.Create(); var ban = new IPRangeBan(rec); AddIPRangeBan(ban); return(ban); }
public void RemoveIPRangeBan(IPRangeBan ban) { Contract.Requires(ban != null); _ipRangeBans.Remove(ban); }
public void AddIPRangeBan(IPRangeBan ban) { Contract.Requires(ban != null); _ipRangeBans.Add(ban); }