示例#1
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (HueOptions != null ? HueOptions.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ChromecastOptions != null ? ChromecastOptions.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (WhitelistedNuimos != null ? GetHashCodeForNuimos(WhitelistedNuimos) : 0);
         return(hashCode);
     }
 }
示例#2
0
        public override bool Equals(object other)
        {
            if (other == null || other.GetType() != typeof(NuimoOptions))
            {
                return(false);
            }

            var otherOptions = (NuimoOptions)other;

            var whitelistSet      = new HashSet <Nuimo>(WhitelistedNuimos);
            var otherWhitelistSet = new HashSet <Nuimo>(otherOptions.WhitelistedNuimos);

            return(HueOptions.Equals(otherOptions.HueOptions) &&
                   ChromecastOptions.Equals(otherOptions.ChromecastOptions) &&
                   whitelistSet.SetEquals(otherWhitelistSet));
        }