示例#1
0
 // 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());
     }
 }
示例#2
0
 // 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);
 }
示例#3
0
 public bool Equals(F5Address other)
 {
     return(IPAddress.Equals(other.IPAddress) && RouteDomain.Equals(other.RouteDomain));
 }
示例#4
0
 public static bool IsMatch(F5Address filter, string address)
 {
     return(filter.IsMatch(address));
 }