public bool Equals(ServerIdentity other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }
            var a = Ports.All(other.Ports.Contains) && Ports.Count == other.Ports.Count;

            return(string.Equals(Address, other.Address) && a &&
                   string.Equals(PortsString, other.PortsString) && ServerRole == other.ServerRole);
        }
示例#2
0
 public void Validate(IObjectValidator validator)
 {
     validator.Verify(!string.IsNullOrWhiteSpace(Name), "Name not specified.");
     validator.Verify(!string.IsNullOrWhiteSpace(Password), "Password not specified.");
     validator.Verify(Ports.All(p => p > 8000), "All port must be greater than 8000.");
 }