Esempio n. 1
0
        public override object ConvertToType(ISessionInterface session, object a, SqlType othType)
        {
            if (a == null)
            {
                return(null);
            }
            if (othType == null)
            {
                return(a);
            }
            if (!othType.IsArrayType())
            {
                throw Error.GetError(0x15ba);
            }
            object[] objArray = (object[])a;
            if (objArray.Length > this._maxCardinality)
            {
                throw Error.GetError(0xda3);
            }
            SqlType other = othType.CollectionBaseType();

            if (this._dataType.Equals(other))
            {
                return(a);
            }
            object[] objArray2 = new object[objArray.Length];
            for (int i = 0; i < objArray.Length; i++)
            {
                objArray2[i] = this._dataType.ConvertToType(session, objArray[i], other);
            }
            return(objArray2);
        }
Esempio n. 2
0
        public override bool CanBeAssignedFrom(SqlType otherType)
        {
            if (otherType == null)
            {
                return(true);
            }
            SqlType type = otherType.CollectionBaseType();

            return((type != null) && this._dataType.CanBeAssignedFrom(type));
        }
Esempio n. 3
0
        public override bool CanConvertFrom(SqlType othType)
        {
            if (othType == null)
            {
                return(true);
            }
            if (!othType.IsArrayType())
            {
                return(false);
            }
            SqlType type = othType.CollectionBaseType();

            return(this._dataType.CanConvertFrom(type));
        }
Esempio n. 4
0
        public override SqlType GetCombinedType(SqlType otherType, int operation)
        {
            if (operation != 0x24)
            {
                return(this.GetAggregateType(otherType));
            }
            if (otherType == null)
            {
                return(this);
            }
            if (!otherType.IsArrayType())
            {
                throw Error.GetError(0x15ba);
            }
            SqlType other = otherType.CollectionBaseType();

            return(new ArrayType(this._dataType.GetAggregateType(other), this._maxCardinality + otherType.ArrayLimitCardinality()));
        }
Esempio n. 5
0
        public override SqlType GetAggregateType(SqlType otherType)
        {
            if (otherType == null)
            {
                return(this);
            }
            if (!otherType.IsArrayType())
            {
                throw Error.GetError(0x15ba);
            }
            SqlType other = otherType.CollectionBaseType();

            if (this._dataType.Equals(other))
            {
                return(this);
            }
            return(new ArrayType(this._dataType.GetAggregateType(other), this._maxCardinality));
        }