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

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

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

            _ipBans.Add(ban);
        }