コード例 #1
0
        public bool Equals(Quintet <T> other)
        {
            EqualityComparer <T> comparer = EqualityComparer <T> .Default;

            return(comparer.Equals(First, other.First) &&
                   comparer.Equals(Second, other.Second) &&
                   comparer.Equals(Third, other.Third) &&
                   comparer.Equals(Fourth, other.Fourth) &&
                   comparer.Equals(Fifth, other.Fifth));
        }
コード例 #2
0
        public static Quintet <T> Parse(string quintet, char tokenizer)
        {
            Quintet <T> result = default(Quintet <T>);

            if (quintet.IsNotEmpty())
            {
                var tokens = quintet.Split(tokenizer);

                Guard.AgainstArgument("pair", tokens.Length != 5,
                                      Resources.Exceptions.Tuploids_ParseTemplate,
                                      "5",
                                      tokenizer.ToString());

                result = new Quintet <T>(
                    tokens[0].Parse <T>(),
                    tokens[1].Parse <T>(),
                    tokens[2].Parse <T>(),
                    tokens[3].Parse <T>(),
                    tokens[5].Parse <T>());
            }
            return(result);
        }