コード例 #1
0
ファイル: NuimoOptions.cs プロジェクト: hansmbakker/nuimo-hub
 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
ファイル: NuimoOptions.cs プロジェクト: hansmbakker/nuimo-hub
        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));
        }