// This differs from Equals: it will match on IP alone if no RouteDomain criteria is specified. public bool IsMatch(string address) { // Built-in matching for the default (Any) filter if (this.Equals(Any)) { return(true); } if (RouteDomain.HasValue) { return(this.ToString() == address); } else { F5Address f5address = new F5Address(address); return(IPAddress.ToString() == f5address.IPAddress.ToString()); } }
// https://msdn.microsoft.com/ru-ru/library/ms173147(v=vs.80).aspx public override bool Equals(Object obj) { // If parameter is null return false. if (obj == null) { return(false); } if (obj is F5Address) { return(this.Equals((F5Address)obj)); } if (obj is IPAddress) { var f5address = new F5Address(((IPAddress)obj).ToString()); return(this.Equals(f5address)); } if (obj is string) { var f5address = new F5Address((string)obj); return(this.Equals(f5address)); } return(false); }
public bool Equals(F5Address other) { return(IPAddress.Equals(other.IPAddress) && RouteDomain.Equals(other.RouteDomain)); }
public static bool IsMatch(F5Address filter, string address) { return(filter.IsMatch(address)); }