private object GetValue(string name, bool oldValue)
        {
            int[]  statusVector = ExtConnection.GetNewStatusVector();
            byte[] fieldName    = new byte[32];
            object value        = null;

            _database.Charset.GetBytes(name, 0, name.Length, fieldName, 0);

            // Marshal structures to pointer
            ParamDscMarshaler marshaler = ParamDscMarshaler.Instance;

            IntPtr valuePtr = marshaler.MarshalManagedToNative();

            bool result = SafeNativeMethods.isc_get_trigger_field(
                statusVector,
                (oldValue) ? 0 : 1,
                fieldName,
                valuePtr);

            value = marshaler.MarshalNativeToManaged(_database.Charset, valuePtr);
            marshaler.CleanUpNativeData(ref valuePtr);

            ExtConnection.ParseStatusVector(statusVector);

            return(value);
        }
Exemplo n.º 2
0
        private void ParseStatusVector(int[] statusVector)
        {
            IscException ex = ExtConnection.ParseStatusVector(statusVector);

            if (ex != null && !ex.IsWarning)
            {
                throw ex;
            }
        }
        public int GetTriggerAction()
        {
            int[] statusVector = ExtConnection.GetNewStatusVector();

            int action = SafeNativeMethods.isc_get_trigger_action(statusVector);

            ExtConnection.ParseStatusVector(statusVector);

            return(action);
        }
Exemplo n.º 4
0
        protected override void Cancel()
        {
            lock (this.db)
            {
                int[] statusVector = ExtConnection.GetNewStatusVector();

                SafeNativeMethods.isc_cancel_blob(statusVector, ref this.blobHandle);

                ExtConnection.ParseStatusVector(statusVector);
            }
        }
        public string GetTableName()
        {
            int[]  statusVector = ExtConnection.GetNewStatusVector();
            byte[] tableName    = new byte[255];

            int count = SafeNativeMethods.isc_get_trigger_table_name(statusVector, tableName, 255);

            ExtConnection.ParseStatusVector(statusVector);

            return(_database.Charset.GetString(tableName, 0, count));
        }
Exemplo n.º 6
0
        protected override void Close()
        {
            lock (_db)
            {
                int[] statusVector = ExtConnection.GetNewStatusVector();

                SafeNativeMethods.isc_close_blob(statusVector, ref _blobHandle);

                ExtConnection.ParseStatusVector(statusVector);
            }
        }
Exemplo n.º 7
0
        protected override void PutSegment(byte[] buffer)
        {
            lock (this.db)
            {
                int[] statusVector = ExtConnection.GetNewStatusVector();

                SafeNativeMethods.isc_put_segment(
                    statusVector,
                    ref this.blobHandle,
                    (short)buffer.Length,
                    buffer);

                ExtConnection.ParseStatusVector(statusVector);
            }
        }
Exemplo n.º 8
0
        internal void ParseStatusVector(int[] statusVector)
        {
            IscException ex = ExtConnection.ParseStatusVector(statusVector);

            if (ex != null)
            {
                if (ex.IsWarning)
                {
                    this.warningMessage(ex);
                }
                else
                {
                    throw ex;
                }
            }
        }
Exemplo n.º 9
0
        protected override void Open()
        {
            lock (this.db)
            {
                int[] statusVector = ExtConnection.GetNewStatusVector();

                int dbHandle = this.db.Handle;
                int trHandle = this.transaction.Handle;

                SafeNativeMethods.isc_open_blob2(
                    statusVector,
                    ref dbHandle,
                    ref trHandle,
                    ref this.blobHandle,
                    ref this.blobId,
                    0,
                    new byte[0]);

                ExtConnection.ParseStatusVector(statusVector);
            }
        }
Exemplo n.º 10
0
        protected override void Create()
        {
            lock (this.db)
            {
                int[] statusVector = ExtConnection.GetNewStatusVector();

                int dbHandle = this.db.Handle;
                int trHandle = this.transaction.Handle;

                SafeNativeMethods.isc_create_blob2(
                    statusVector,
                    ref dbHandle,
                    ref trHandle,
                    ref this.blobHandle,
                    ref this.blobId,
                    0,
                    new byte[0]);

                ExtConnection.ParseStatusVector(statusVector);

                this.RblAddValue(IscCodes.RBL_create);
            }
        }