Exemplo n.º 1
0
        /// <summary>
        /// Construct a new NpgsqlTypeInfo with the given attributes and conversion handlers.
        /// </summary>
        /// <param name="OID">Type OID provided by the backend server.</param>
        /// <param name="Name">Type name provided by the backend server.</param>
        /// <param name="NpgsqlDbType">NpgsqlDbType</param>
        /// <param name="Type">System type to convert fields of this type to.</param>
        /// <param name="ConvertBackendToNative">Data conversion handler.</param>
        /// <param name="ConvertNativeToBackend">Data conversion handler.</param>
        public NpgsqlNativeTypeInfo(String Name, NpgsqlDbType NpgsqlDbType, DbType DbType, Boolean Quote, ConvertNativeToBackendHandler ConvertNativeToBackend)
        {
            _Name                   = Name;
            _NpgsqlDbType           = NpgsqlDbType;
            _DbType                 = DbType;
            _Quote                  = Quote;
            _ConvertNativeToBackend = ConvertNativeToBackend;


            // The only parameters types which use length currently supported are char and varchar. Check for them.

            if ((NpgsqlDbType == NpgsqlDbType.Char) ||
                (NpgsqlDbType == NpgsqlDbType.Varchar))
            {
                _UseSize = true;
            }
            else
            {
                _UseSize = false;
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Add a new NpgsqlNativeTypeInfo with the given attributes and conversion handlers to this mapping.
 /// </summary>
 /// <param name="OID">Type OID provided by the backend server.</param>
 /// <param name="Name">Type name provided by the backend server.</param>
 /// <param name="NpgsqlDbType">NpgsqlDbType</param>
 /// <param name="ConvertBackendToNative">Data conversion handler.</param>
 /// <param name="ConvertNativeToBackend">Data conversion handler.</param>
 public void AddType(String Name, NpgsqlDbType NpgsqlDbType, DbType DbType, Boolean Quote,
                     ConvertNativeToBackendHandler NativeConvert)
 {
     AddType(new NpgsqlNativeTypeInfo(Name, NpgsqlDbType, DbType, Quote, NativeConvert));
 }
Exemplo n.º 3
0
 /// <summary>
 /// Construct a new NpgsqlTypeInfo with the given attributes and conversion handlers.
 /// </summary>
 /// <param name="OID">Type OID provided by the backend server.</param>
 /// <param name="Name">Type name provided by the backend server.</param>
 /// <param name="NpgsqlDbType">NpgsqlDbType</param>
 /// <param name="Type">System type to convert fields of this type to.</param>
 /// <param name="ConvertBackendToNative">Data conversion handler.</param>
 /// <param name="ConvertNativeToBackend">Data conversion handler.</param>
 public NpgsqlNativeTypeInfo(String Name, NpgsqlDbType NpgsqlDbType, DbType DbType, Boolean Quote, ConvertNativeToBackendHandler ConvertNativeToBackend)
 {
     _Name = Name;
     _NpgsqlDbType = NpgsqlDbType;
     _DbType = DbType;
     _Quote = Quote;
     _ConvertNativeToBackend = ConvertNativeToBackend;
     
     
     // The only parameters types which use length currently supported are char and varchar. Check for them.
     
     if ( (NpgsqlDbType == NpgsqlDbType.Char)
         || (NpgsqlDbType == NpgsqlDbType.Varchar))
         
         _UseSize = true;
     else
         _UseSize = false;
 }
Exemplo n.º 4
0
 /// <summary>
 /// Add a new NpgsqlNativeTypeInfo with the given attributes and conversion handlers to this mapping.
 /// </summary>
 /// <param name="OID">Type OID provided by the backend server.</param>
 /// <param name="Name">Type name provided by the backend server.</param>
 /// <param name="NpgsqlDbType">NpgsqlDbType</param>
 /// <param name="ConvertBackendToNative">Data conversion handler.</param>
 /// <param name="ConvertNativeToBackend">Data conversion handler.</param>
 public void AddType(String Name, NpgsqlDbType NpgsqlDbType, DbType DbType, Boolean Quote,
                     ConvertNativeToBackendHandler NativeConvert)
 {
     AddType(new NpgsqlNativeTypeInfo(Name, NpgsqlDbType, DbType, Quote, NativeConvert));
 }
 /// <summary>
 /// Construct a new NpgsqlTypeInfo with the given attributes and conversion handlers.
 /// </summary>
 /// <param name="OID">Type OID provided by the backend server.</param>
 /// <param name="Name">Type name provided by the backend server.</param>
 /// <param name="NpgsqlDbType">NpgsqlDbType</param>
 /// <param name="Type">System type to convert fields of this type to.</param>
 /// <param name="ConvertBackendToNative">Data conversion handler.</param>
 /// <param name="ConvertNativeToBackend">Data conversion handler.</param>
 public NpgsqlNativeTypeInfo(String Name, NpgsqlDbType NpgsqlDbType, DbType DbType, Boolean Quote, ConvertNativeToBackendHandler ConvertNativeToBackend)
 {
     _Name = Name;
     _NpgsqlDbType = NpgsqlDbType;
     _DbType = DbType;
     _Quote = Quote;
     _ConvertNativeToBackend = ConvertNativeToBackend;
 }