Exemplo n.º 1
0
        public bool Equals(Constraint other)
        {
            bool ret = false;

            if (other == this)
            {
                ret = true;
            }
            else
            {
                if (other != null)
                {
                    if (typeParameter == null && other.typeParameter == null ||
                        typeParameter != null && typeParameter.Equals(other.typeParameter)
                        )
                    {
                        if (constructorConstraint == null && other.constructorConstraint == null ||
                            constructorConstraint != null && other.constructorConstraint != null
                            )
                        {
                            if (constraintExpressions.Count == other.constraintExpressions.Count)
                            {
                                ret = true;

                                for (int i = 0; i < constraintExpressions.Count; ++i)
                                {
                                    if (!constraintExpressions[i].Equals(other.constraintExpressions[i]))
                                    {
                                        ret = false;
                                        break;
                                    }
                                }
                            }
                        }
                    }
                }
            }

            return(ret);
        }