Exemplo n.º 1
0
        public int CompareTo(ContentMetaKey other)
        {
            if (ReferenceEquals(this, other))
            {
                return(0);
            }
            if (ReferenceEquals(null, other))
            {
                return(1);
            }
            int titleIdComparison = TitleId.CompareTo(other.TitleId);

            if (titleIdComparison != 0)
            {
                return(titleIdComparison);
            }
            int versionComparison = Version.CompareTo(other.Version);

            if (versionComparison != 0)
            {
                return(versionComparison);
            }
            int typeComparison = Type.CompareTo(other.Type);

            if (typeComparison != 0)
            {
                return(typeComparison);
            }
            return(Flags.CompareTo(other.Flags));
        }
Exemplo n.º 2
0
 public int CompareTo(ContentMetaKey other)
 {
     if (ReferenceEquals(this, other)) return 0;
     if (ReferenceEquals(null, other)) return 1;
     int titleIdComparison = TitleId.CompareTo(other.TitleId);
     if (titleIdComparison != 0) return titleIdComparison;
     int versionComparison = Version.CompareTo(other.Version);
     if (versionComparison != 0) return versionComparison;
     int typeComparison = Type.CompareTo(other.Type);
     if (typeComparison != 0) return typeComparison;
     return Flags.CompareTo(other.Flags);
 }
Exemplo n.º 3
0
 public override int GetHashCode()
 {
     unchecked
     {
         // ReSharper disable NonReadonlyMemberInGetHashCode
         int hashCode = TitleId.GetHashCode();
         hashCode = (hashCode * 397) ^ (int)Version;
         hashCode = (hashCode * 397) ^ Type.GetHashCode();
         hashCode = (hashCode * 397) ^ Flags.GetHashCode();
         return(hashCode);
         // ReSharper restore NonReadonlyMemberInGetHashCode
     }
 }