Exemplo n.º 1
0
        public override bool Equals(IValue other)
        {
            var otherWrapper = other.GetRawValue() as CLREnumValueWrapper <T>;

            if (otherWrapper == null)
            {
                return(false);
            }

            return(UnderlyingValue.Equals(otherWrapper.UnderlyingValue));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Determines whether the specified <see cref="T:System.Object"/> is equal to the current <see cref="T:System.Object"/>.
        /// </summary>
        /// <param name="obj">The <see cref="T:System.Object"/> to compare with the current <see cref="T:System.Object"/>.</param>
        /// <returns>
        /// true if the specified <see cref="T:System.Object"/> is equal to the current <see cref="T:System.Object"/>; otherwise, false.
        /// </returns>
        /// <exception cref="T:System.NullReferenceException">
        /// The <paramref name="obj"/> parameter is null.
        /// </exception>
        public override bool Equals(object obj)
        {
            var otherBindable = obj as BindableEnum;

            if (otherBindable != null)
            {
                return(UnderlyingValue == otherBindable.UnderlyingValue);
            }

            if (obj is int)
            {
                return(UnderlyingValue.Equals((int)obj));
            }

            return(false);
        }