Esempio n. 1
0
        internal commit_hook_info(delegate_commit func, object v)
        {
            _func      = func;
            _user_data = v;

            _h = GCHandle.Alloc(this);
        }
Esempio n. 2
0
        void ISQLite3Provider.sqlite3_commit_hook(IntPtr db, delegate_commit func, object v)
        {
            if (_commit_hook != null)
            {
                // TODO maybe turn off the hook here, for now
                _commit_hook.free();
                _commit_hook = null;
            }

            if (func != null)
            {
                _commit_hook = new commit_hook_info(func, v);
                SQLite3RuntimeProvider.sqlite3_commit_hook(db.ToInt64(), Marshal.GetFunctionPointerForDelegate(new callback_commit(commit_hook_bridge)).ToInt64(), _commit_hook.ptr.ToInt64());
            }
            else
            {
                SQLite3RuntimeProvider.sqlite3_commit_hook(db.ToInt64(), IntPtr.Zero.ToInt64(), IntPtr.Zero.ToInt64());
            }
        }
Esempio n. 3
0
 internal void free()
 {
     _func      = null;
     _user_data = null;
     _h.Free();
 }
Esempio n. 4
0
 void ISQLite3Provider.sqlite3_commit_hook(IntPtr db, delegate_commit func, object v)
 {
     throw new Exception(GRIPE);
 }
Esempio n. 5
0
 public commit_hook_info(delegate_commit func, object v)
 {
     _func      = func;
     _user_data = v;
 }
Esempio n. 6
0
 static public void sqlite3_commit_hook(sqlite3 db, delegate_commit f, object v)
 {
     _imp.sqlite3_commit_hook(db.ptr, f, v);
 }
        void ISQLite3Provider.sqlite3_commit_hook (IntPtr db, delegate_commit func, object v)
        {
            var info = hooks.getOrCreateFor (db);
            if (info.commit != null) {
                // TODO maybe turn off the hook here, for now
                info.commit.free ();
                info.commit = null;
            }

            if (func != null) {
                info.commit = new commit_hook_info (func, v);
                NativeMethods.sqlite3_commit_hook (db, commit_hook_bridge, info.commit.ptr);
            } else {
                NativeMethods.sqlite3_commit_hook (db, null, IntPtr.Zero);
            }
        }
Esempio n. 8
0
 static public void sqlite3_commit_hook(sqlite3 db, delegate_commit f, object v)
 {
     _imp.sqlite3_commit_hook(db.ptr, f, v);
 }
Esempio n. 9
0
 public static void commit_hook(this sqlite3 db, delegate_commit f, object v)
 {
     raw.sqlite3_commit_hook(db, f, v);
 }
Esempio n. 10
0
 internal void free()
 {
     _func = null;
     _user_data = null;
     _h.Free();
 }
Esempio n. 11
0
        internal commit_hook_info(delegate_commit func, object v)
        {
            _func = func;
            _user_data = v;

            _h = GCHandle.Alloc(this);
        }
 public void sqlite3_commit_hook(IntPtr db, delegate_commit func, object v) => throw new NotImplementedException();
Esempio n. 13
0
        void ISQLite3Provider.sqlite3_commit_hook(IntPtr db, delegate_commit func, object v)
        {
            if (_commit_hook != null)
            {
                // TODO maybe turn off the hook here, for now
                _commit_hook.free();
                _commit_hook = null;
            }

            if (func != null)
            {
                _commit_hook = new commit_hook_info(func, v);
                NativeMethods.sqlite3_commit_hook(db, commit_hook_bridge, _commit_hook.ptr);
            }
            else
            {
                NativeMethods.sqlite3_commit_hook(db, null, IntPtr.Zero);
            }
        }
Esempio n. 14
0
        void ISQLite3Provider.sqlite3_commit_hook(IntPtr db, delegate_commit func, object v)
        {
		var info = hooks.getOrCreateFor(db);
            if (info.commit != null)
            {
                // TODO maybe turn off the hook here, for now
                info.commit.free();
                info.commit = null;
            }

            if (func != null)
            {
                info.commit = new commit_hook_info(func, v);
                SQLite3RuntimeProvider.sqlite3_commit_hook(db.ToInt64(), Marshal.GetFunctionPointerForDelegate(commit_hook_bridge).ToInt64(), info.commit.ptr.ToInt64());
            }
            else
            {
                SQLite3RuntimeProvider.sqlite3_commit_hook(db.ToInt64(), IntPtr.Zero.ToInt64(), IntPtr.Zero.ToInt64());
            }
        }
Esempio n. 15
0
        void ISQLite3Provider.sqlite3_commit_hook(IntPtr db, delegate_commit func, object v)
        {
	    throw new Exception(GRIPE);
        }
Esempio n. 16
0
        void ISQLite3Provider.sqlite3_commit_hook(IntPtr db, delegate_commit func, object v)
        {
            if (_commit_hook != null)
            {
                // TODO maybe turn off the hook here, for now
                _commit_hook.free();
                _commit_hook = null;
            }

            if (func != null)
            {
                _commit_hook = new commit_hook_info(func, v);
                SQLite3RuntimeProvider.sqlite3_commit_hook(db.ToInt64(), Marshal.GetFunctionPointerForDelegate(new callback_commit(commit_hook_bridge)).ToInt64(), _commit_hook.ptr.ToInt64());
            }
            else
            {
                SQLite3RuntimeProvider.sqlite3_commit_hook(db.ToInt64(), IntPtr.Zero.ToInt64(), IntPtr.Zero.ToInt64());
            }
        }