Esempio n. 1
0
        //public override object NullValue
        //{
        //    get { throw new InvalidCastException("UnknownTypeHandler could not cast a null value in unknown type field."); }
        //}

        /// <summary>
        ///  Compares two values (that this handler deals with) for equality
        /// </summary>
        /// <param name="obj">one of the objects</param>
        /// <param name="str">the other object as a String</param>
        /// <returns>true if they are equal</returns>
        public override bool Equals(object obj, string str)
        {
            if (obj == null || str == null)
            {
                return((string)obj == str);
            }
            ITypeHandler handler      = _factory.GetTypeHandler(obj.GetType());
            object       castedObject = handler.ValueOf(obj.GetType(), str);

            return(obj.Equals(castedObject));
        }