コード例 #1
0
        public override int GetHashCode()
        {
            HashCodeCombiner combiner = new HashCodeCombiner();

            combiner.AddObject(this._varyByCustom);
            combiner.AddArray(this._varyByParams);
            combiner.AddArray(this._varyByControls);
            return(combiner.CombinedHash32);
        }
コード例 #2
0
        public override int GetHashCode()
        {
            HashCodeCombiner hashCodeCombiner = new HashCodeCombiner();

            // We need non-randomized hash code for _varyByCustom
            hashCodeCombiner.AddInt(StringUtil.GetNonRandomizedHashCode(_varyByCustom));

            hashCodeCombiner.AddArray(_varyByParams);
            hashCodeCombiner.AddArray(_varyByControls);
            return(hashCodeCombiner.CombinedHash32);
        }
コード例 #3
0
        public override int GetHashCode()
        {
            HashCodeCombiner hashCodeCombiner = new HashCodeCombiner();

            // Cast _varyByCustom to an object, since the HashCodeCombiner.AddObject(string)
            // overload uses StringUtil.GetStringHashCode().  We want to use String.GetHashCode()
            // in this method, since we do not require a stable hash code across architectures.
            hashCodeCombiner.AddObject((object)_varyByCustom);

            hashCodeCombiner.AddArray(_varyByParams);
            hashCodeCombiner.AddArray(_varyByControls);
            return(hashCodeCombiner.CombinedHash32);
        }