protected static bool EqualOperator(ObjetoValor left, ObjetoValor right) { if (ReferenceEquals(left, null) ^ ReferenceEquals(right, null)) { return(false); } return(ReferenceEquals(left, null) || left.Equals(right)); }
public override bool Equals(object obj) { if (obj == null || obj.GetType() != GetType()) { return(false); } ObjetoValor other = (ObjetoValor)obj; IEnumerator <object> thisValues = ObterValoresAtomicos().GetEnumerator(); IEnumerator <object> otherValues = other.ObterValoresAtomicos().GetEnumerator(); while (thisValues.MoveNext() && otherValues.MoveNext()) { if (ReferenceEquals(thisValues.Current, null) ^ ReferenceEquals(otherValues.Current, null)) { return(false); } if (thisValues.Current != null && !thisValues.Current.Equals(otherValues.Current)) { return(false); } } return(!thisValues.MoveNext() && !otherValues.MoveNext()); }
protected static bool NotEqualOperator(ObjetoValor left, ObjetoValor right) { return(!(EqualOperator(left, right))); }