Ejemplo n.º 1
0
        /// <summary>
        /// Converts Magic 'Blob' Type to 'dotNetType'
        /// </summary>
        /// <param name="magicVal"></param>
        /// <param name="dotNetType"></param>
        /// <returns></returns>
        private static object convertBlobToDotNet(string magicVal, Type dotNetType)
        {
            Object retObject = null;

            if (dotNetType == typeof(Byte))
            {
                retObject = BlobType.getBytes(magicVal)[0];
            }
            else if (dotNetType == typeof(Byte[]))
            {
                retObject = BlobType.getBytes(magicVal);
            }
            else if (dotNetType == typeof(Char))
            {
                retObject = ReflectionServices.DynCast(BlobType.getString(magicVal), dotNetType);
            }
            else if (dotNetType == typeof(Char[]))
            {
                retObject = BlobType.getString(magicVal).ToCharArray();
            }
            else if (dotNetType == typeof(String))
            {
                retObject = BlobType.getString(magicVal);
            }
            else if (dotNetType == typeof(StringBuilder))
            {
                retObject = new StringBuilder(BlobType.getString(magicVal));
            }

            return(retObject);
        }
Ejemplo n.º 2
0
        internal override object ConvertRuntimeFieldToGateway(DBField dbField, string runtimeValue)
        {
            GatewayBlob gatewayValue = new GatewayBlob();

            gatewayValue.Blob        = BlobType.getBytes(runtimeValue);
            gatewayValue.blobContent = BlobContent.Binary;
            gatewayValue.BlobSize    = BlobType.getBlobSize(runtimeValue);
            return(gatewayValue);
        }