Пример #1
0
 public ManifestVersionUpdate(ManifestId manifestId, ManifestVersion?existingVersion, string?existingFeatureBand, ManifestVersion?newVersion, string?newFeatureBand)
 {
     ManifestId          = manifestId;
     ExistingVersion     = existingVersion;
     ExistingFeatureBand = existingFeatureBand;
     NewVersion          = newVersion;
     NewFeatureBand      = newFeatureBand;
 }
Пример #2
0
        public int CompareTo(ManifestVersionUpdate?other)
        {
            if (other == null)
            {
                return(1);
            }
            int ret = ManifestId.CompareTo(other.ManifestId);

            if (ret != 0)
            {
                return(ret);
            }

            if (ExistingVersion == null && other.ExistingVersion != null)
            {
                return(-1);
            }
            if (ExistingVersion != null && other.ExistingVersion == null)
            {
                return(1);
            }
            if (ExistingVersion != null)
            {
                ret = ExistingVersion.CompareTo(other.ExistingVersion);
                if (ret != 0)
                {
                    return(ret);
                }
            }

            ret = string.Compare(ExistingFeatureBand, other.ExistingFeatureBand, StringComparison.Ordinal);
            if (ret != 0)
            {
                return(ret);
            }

            if (NewVersion == null && other.NewVersion != null)
            {
                return(-1);
            }
            if (NewVersion != null && other.NewVersion == null)
            {
                return(1);
            }
            if (NewVersion != null)
            {
                ret = NewVersion.CompareTo(other.NewVersion);
                if (ret != 0)
                {
                    return(ret);
                }
            }

            ret = string.Compare(NewFeatureBand, other.NewFeatureBand, StringComparison.Ordinal);
            return(ret);
        }
Пример #3
0
        public override int GetHashCode()
        {
#if NETCOREAPP3_1_OR_GREATER
            return(HashCode.Combine(ManifestId, ExistingVersion, ExistingFeatureBand, NewVersion, NewFeatureBand));
#else
            int hashCode = 1601069575;
            hashCode = hashCode * -1521134295 + ManifestId.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <ManifestVersion?> .Default.GetHashCode(ExistingVersion);

            hashCode = hashCode * -1521134295 + EqualityComparer <string?> .Default.GetHashCode(ExistingFeatureBand);

            hashCode = hashCode * -1521134295 + EqualityComparer <ManifestVersion?> .Default.GetHashCode(NewVersion);

            hashCode = hashCode * -1521134295 + EqualityComparer <string?> .Default.GetHashCode(NewFeatureBand);

            return(hashCode);
#endif
        }