public override bool Equals(object obj) { if (obj == null || this.GetType() != obj.GetType()) { return(false); } IPAddress_v4 c = (IPAddress_v4)obj; return(this.Value == c.Value); }
public bool?Validate(HttpRequest request) { IPAddress_v4 ip = IPAddress_v4.TryCreate(request.UserHostAddress); if (ip == null) { return(null); } if (this.IPAddresses.Contains(ip) == true) { return(false); } return(null); }
public Boolean?Validate(HttpRequest request) { var req = request; IPAddress_v4 ip = IPAddress_v4.TryCreate(req.UserHostAddress); if (ip == null) { return(null); } if (this.Start.Value <= ip.Value && ip.Value <= this.End.Value) { return(this.Allow); } return(!this.Allow); }
public IPAddressCondition(IPAddress_v4 start, IPAddress_v4 end, Boolean allow) { this.Start = start; this.End = end; this.Allow = allow; }
public IPAddressCondition(IPAddress_v4 start, IPAddress_v4 end) { this.Start = start; this.End = end; this.Allow = false; }
public IPAddressCondition(IPAddress_v4 address) { this.Start = address; this.End = address; this.Allow = false; }