private static ReleaseDate ParseReleaseDateTriplet(string[] triplet)
        {
            ReleaseDate releaseDate = new ReleaseDate();

            int part0 = ParseNumberOrMonth(triplet[0]);
            int part1 = ParseNumberOrMonth(triplet[1]);
            int part2 = ParseNumberOrMonth(triplet[2]);

            if (part0 > 50)
            {
                if (IsMonth(triplet[1]))
                {
                    return new ReleaseDate(part0, part1, part2);
                }
                else if (IsMonth(triplet[2]))
                {
                    return new ReleaseDate(part0, part2, part1);
                }
                return new ReleaseDate();
            }
            else if (part2 > 50)
            {
                if (IsMonth(triplet[0]))
                {
                    return new ReleaseDate(part2, part0, part1);
                }
                else if (IsMonth(triplet[1]))
                {
                    return new ReleaseDate(part2, part1, part0);
                }
            }

            return new ReleaseDate();
        }
Esempio n. 2
0
        public override bool Equals(object obj)
        {
            ReleaseDate other = obj as ReleaseDate;

            if (other == null)
            {
                return(false);
            }
            return(other.Type == this.Type && other.Date == this.Date);
        }