Example #1
0
        public void DeleteIPBan(IPBan ban)
        {
            Contract.Requires(ban != null);

            ban.Delete();
            RemoveIPBan(ban);
        }
Example #2
0
        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);
        }
Example #3
0
        public void RemoveIPBan(IPBan ban)
        {
            Contract.Requires(ban != null);

            _ipBans.Remove(ban);
        }
Example #4
0
        public void AddIPBan(IPBan ban)
        {
            Contract.Requires(ban != null);

            _ipBans.Add(ban);
        }