Ejemplo n.º 1
0
        public bool Equals(IPAddressRange other)
        {
            if (other == null)
                return false;

            Contract.Assume(other._lowerBoundary != null);
            Contract.Assume(other._upperBoundary != null);
            return other.Family == Family && other._lowerBoundary.SequenceEqual(_lowerBoundary) && other._upperBoundary.SequenceEqual(_upperBoundary);
        }
Ejemplo n.º 2
0
        public void CreateIPRangeBan(IPAddressRange range, string notes, DateTime? expiry)
        {
            var ban = BanManager.Instance.FindIPRangeBan(x => x.Range.Equals(range));

            if (ban != null)
                throw new ArgumentException("IP range ban already exists.");

            BanManager.Instance.CreateIPRangeBan(range, notes, expiry);
        }
Ejemplo n.º 3
0
 public void CreateIPRangeBan(IPAddressRange range, string notes, DateTime? expiry)
 {
     Contract.Requires(range != null);
 }
Ejemplo n.º 4
0
        public void CreateIPRangeBan(IPAddressRange range, string notes, DateTime? expiry)
        {
            IPRangeBan ban = null;
            BanManager.Instance.PostWait(mgr => ban = mgr.FindIPRangeBan(x => x.Range.Equals(range))).Wait();

            if (ban != null)
                throw new ArgumentException("IP range ban already exists.");

            BanManager.Instance.PostAsync(mgr => mgr.CreateIPRangeBan(range, notes, expiry));
        }