Beispiel #1
0
        public override string ToString()
        {
            StringBuilder result = new StringBuilder();

            result.Append(NewMissions.First().Name + " updated from ");

            if (!OldMissions.Any())
            {
                result.Append("NONE");
            }
            var isFirst = true;

            foreach (var version in OldMissions.Select(m => m.Version))
            {
                result.Append((isFirst ? "" : ", ") + version);
                isFirst = false;
            }

            result.Append(" to ");

            isFirst = true;
            foreach (var version in NewMissions.Select(m => m.Version))
            {
                result.Append((isFirst ? "" : ", ") + version);
                isFirst = false;
            }

            return(result.ToString());
        }
Beispiel #2
0
 public override int GetHashCode()
 {
     unchecked
     {
         return(((OldMissions != null ? OldMissions.GetHashCode() : 0) * 397) ^
                (NewMissions != null ? NewMissions.GetHashCode() : 0));
     }
 }
Beispiel #3
0
 public bool Equals(MissionUpdate other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(OldMissions.SequenceEqual(other.OldMissions) && NewMissions.SequenceEqual(other.NewMissions));
 }