Beispiel #1
0
        /// <summary>
        /// Verifica se é igual a instancia informada.
        /// </summary>
        /// <param name="other"></param>
        /// <returns></returns>
        public bool Equals(IMessageFormattable other)
        {
            if (other == null)
            {
                return(false);
            }
            var other2 = other as JoinMessageFormattable;

            if (other2 != null)
            {
                return(((_leftMessage != null && other2._leftMessage != null && _leftMessage.Equals(other2._leftMessage)) || (_leftMessage == null && other2._leftMessage == null)) && ((_rightMessage != null && other2._rightMessage != null && _rightMessage.Equals(other2._rightMessage)) || (_rightMessage == null && other2._rightMessage == null)));
            }
            return(false);
        }
Beispiel #2
0
        /// <summary>
        /// Verifica se as instancias informadas são iguais.
        /// </summary>
        /// <param name="x"></param>
        /// <param name="y"></param>
        /// <returns></returns>
        public override bool Equals(IMessageFormattable x, IMessageFormattable y)
        {
            if (object.ReferenceEquals(x, y))
            {
                return(true);
            }
            if ((x == null) || (y == null))
            {
                return(false);
            }
            if (!_ignoreCase)
            {
                return(x.Equals(y));
            }
            var xStr = x.Format(_culture);
            var yStr = y.Format(_culture);

            if (xStr.Length != yStr.Length)
            {
                return(false);
            }
            return(StringComparer.OrdinalIgnoreCase.Compare(xStr, yStr) == 0);
        }