Пример #1
0
        public void DeleteIPRangeBan(IPRangeBan ban)
        {
            Contract.Requires(ban != null);

            ban.Delete();
            RemoveIPRangeBan(ban);
        }
Пример #2
0
        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);
        }
Пример #3
0
        public void RemoveIPRangeBan(IPRangeBan ban)
        {
            Contract.Requires(ban != null);

            _ipRangeBans.Remove(ban);
        }
Пример #4
0
        public void AddIPRangeBan(IPRangeBan ban)
        {
            Contract.Requires(ban != null);

            _ipRangeBans.Add(ban);
        }