public int GetHashCode(NuGetFramework obj)
        {
            if (ReferenceEquals(obj, null))
            {
                return(0);
            }

            var combiner = new HashCodeCombiner();

            combiner.AddStringIgnoreCase(obj.Framework);
            combiner.AddObject(obj.Version);
            combiner.AddStringIgnoreCase(obj.Profile);

            return(combiner.CombinedHash);
        }
Пример #2
0
        public override int GetHashCode()
        {
            if (_hashCode == null)
            {
                var combiner = new HashCodeCombiner();
                // Ensure that this is different from AssetTargetFallback & FallbackFramework;
                combiner.AddStringIgnoreCase(nameof(DualCompatibilityFramework));
                combiner.AddObject(Comparer.GetHashCode(RootFramework));
                combiner.AddObject(Comparer.GetHashCode(SecondaryFramework));
                _hashCode = combiner.CombinedHash;
            }

            return(_hashCode.Value);
        }
Пример #3
0
        public int GetHashCode(FrameworkRange obj)
        {
            if (Object.ReferenceEquals(obj, null))
            {
                return(0);
            }

            HashCodeCombiner combiner = new HashCodeCombiner();

            combiner.AddStringIgnoreCase(obj.FrameworkIdentifier);
            combiner.AddObject(obj.Min);
            combiner.AddObject(obj.Max);

            return(combiner.CombinedHash);
        }
Пример #4
0
        public override int GetHashCode()
        {
            if (_hashCode == null)
            {
                var combiner = new HashCodeCombiner();

                // Ensure that this is different from a FallbackFramework;
                combiner.AddStringIgnoreCase("assettargetfallback");

                combiner.AddObject(Comparer.GetHashCode(this));

                foreach (var each in Fallback)
                {
                    combiner.AddObject(Comparer.GetHashCode(each));
                }

                _hashCode = combiner.CombinedHash;
            }

            return(_hashCode.Value);
        }