ConvertFromBigInteger() static private method

static private ConvertFromBigInteger ( System.Numerics.BigInteger value, Type type, IFormatProvider formatProvider ) : object
value System.Numerics.BigInteger
type Type
formatProvider IFormatProvider
return object
 public static object ChangeTypeForDefaultValue(object value, Type type, IFormatProvider formatProvider)
 {
     if (type == typeof(BigInteger))
     {
         if ((DBNull.Value != value) && (value != null))
         {
             return(BigIntegerStorage.ConvertToBigInteger(value, formatProvider));
         }
         return(DBNull.Value);
     }
     if (value is BigInteger)
     {
         return(BigIntegerStorage.ConvertFromBigInteger((BigInteger)value, type, formatProvider));
     }
     return(ChangeType2(value, DataStorage.GetStorageType(type), type, formatProvider));
 }
Exemplo n.º 2
0
        // this should not be called for XmlSerialization
        public static object ChangeTypeForDefaultValue(object value, Type type, IFormatProvider formatProvider)
        {
            if (type == typeof(System.Numerics.BigInteger))
            {
                if ((DBNull.Value == value) || (null == value))
                {
                    return(DBNull.Value);
                }
                return(BigIntegerStorage.ConvertToBigInteger(value, formatProvider));
            }
            else if (value is System.Numerics.BigInteger)
            {
                return(BigIntegerStorage.ConvertFromBigInteger((System.Numerics.BigInteger)value, type, formatProvider));
            }

            return(ChangeType2(value, DataStorage.GetStorageType(type), type, formatProvider));
        }