예제 #1
0
파일: TValue.cs 프로젝트: lance2088/ili
        /*
         * public bool CheckIfFalseNullZero()
         * {
         *  if (IsRef)
         *      return false; // ref is always true
         *  if (value == null) // null or empty
         *      return true;
         *
         *  return value.GetType().IsValueType ? TValueHelper.CheckIfFalseNullZero(this) : false;
         * }
         */

        public int CompareTo(TValue other, bool signed = true)
        {
            if (value == null && other.Value == null)
            {
                return(0);
            }

            if (value != null && other.Value != null)
            {
                if (value.GetType().IsValueType&& other.Value.GetType().IsValueType)
                {
                    return(TValueHelper.CompareTo(this, other, signed));
                }

                if (!value.GetType().IsValueType&& !other.Value.GetType().IsValueType)
                {
                    return(value.Equals(other.Value) ? 0 : 1);
                }

                return(1);
            }

            return(1);
        }
예제 #2
0
파일: TValue.cs 프로젝트: lance2088/ili
 public TValue ConvertTo(Type t)
 {
     return(TValueHelper.ConvertTo(this, t));
 }