Beispiel #1
0
        internal profile_hook_info(delegate_profile func, object v)
        {
            _func      = func;
            _user_data = v;

            _h = GCHandle.Alloc(this);
        }
Beispiel #2
0
        void ISQLite3Provider.sqlite3_profile(IntPtr db, delegate_profile func, object v)
        {
            if (_profile_hook != null)
            {
                // TODO maybe turn off the hook here, for now
                _profile_hook.free();
                _profile_hook = null;
            }

            if (func != null)
            {
                _profile_hook = new profile_hook_info(func, v);
                SQLite3RuntimeProvider.sqlite3_profile(db.ToInt64(), Marshal.GetFunctionPointerForDelegate(new callback_profile(profile_hook_bridge)).ToInt64(), _profile_hook.ptr.ToInt64());
            }
            else
            {
                SQLite3RuntimeProvider.sqlite3_profile(db.ToInt64(), IntPtr.Zero.ToInt64(), IntPtr.Zero.ToInt64());
            }
        }
Beispiel #3
0
 internal void free()
 {
     _func      = null;
     _user_data = null;
     _h.Free();
 }
Beispiel #4
0
 void ISQLite3Provider.sqlite3_profile(IntPtr db, delegate_profile func, object v)
 {
     throw new Exception(GRIPE);
 }
Beispiel #5
0
 public profile_hook_info(delegate_profile func, object v)
 {
     _func      = func;
     _user_data = v;
 }
Beispiel #6
0
 static public void sqlite3_profile(sqlite3 db, delegate_profile f, object v)
 {
     _imp.sqlite3_profile(db.ptr, f, v);
 }
        void ISQLite3Provider.sqlite3_profile (IntPtr db, delegate_profile func, object v)
        {
            var info = hooks.getOrCreateFor (db);
            if (info.profile != null) {
                // TODO maybe turn off the hook here, for now
                info.profile.free ();
                info.profile = null;
            }

            if (func != null) {
                info.profile = new profile_hook_info (func, v);
                NativeMethods.sqlite3_profile (db, profile_hook_bridge, info.profile.ptr);
            } else {
                NativeMethods.sqlite3_profile (db, null, IntPtr.Zero);
            }
        }
Beispiel #8
0
 static public void sqlite3_profile(sqlite3 db, delegate_profile f, object v)
 {
     _imp.sqlite3_profile(db.ptr, f, v);
 }
Beispiel #9
0
 public static void profile(this sqlite3 db, delegate_profile f, object v)
 {
     raw.sqlite3_profile(db, f, v);
 }
Beispiel #10
0
 internal void free()
 {
     _func = null;
     _user_data = null;
     _h.Free();
 }
Beispiel #11
0
        internal profile_hook_info(delegate_profile func, object v)
        {
            _func = func;
            _user_data = v;

            _h = GCHandle.Alloc(this);
        }
 public void sqlite3_profile(IntPtr db, delegate_profile func, object v) => throw new NotImplementedException();
        void ISQLite3Provider.sqlite3_profile(IntPtr db, delegate_profile func, object v)
        {
            if (_profile_hook != null)
            {
                // TODO maybe turn off the hook here, for now
                _profile_hook.free();
                _profile_hook = null;
            }

            if (func != null)
            {
                _profile_hook = new profile_hook_info(func, v);
                NativeMethods.sqlite3_profile(db, profile_hook_bridge, _profile_hook.ptr);
            }
            else
            {
                NativeMethods.sqlite3_profile(db, null, IntPtr.Zero);
            }
        }
        void ISQLite3Provider.sqlite3_profile(IntPtr db, delegate_profile func, object v)
        {
		var info = hooks.getOrCreateFor(db);
            if (info.profile != null)
            {
                // TODO maybe turn off the hook here, for now
                info.profile.free();
                info.profile = null;
            }

            if (func != null)
            {
                info.profile = new profile_hook_info(func, v);
                SQLite3RuntimeProvider.sqlite3_profile(db.ToInt64(), Marshal.GetFunctionPointerForDelegate(profile_hook_bridge).ToInt64(), info.profile.ptr.ToInt64());
            }
            else
            {
                SQLite3RuntimeProvider.sqlite3_profile(db.ToInt64(), IntPtr.Zero.ToInt64(), IntPtr.Zero.ToInt64());
            }
        }
Beispiel #15
0
        void ISQLite3Provider.sqlite3_profile(IntPtr db, delegate_profile func, object v)
        {
	    throw new Exception(GRIPE);
        }
        void ISQLite3Provider.sqlite3_profile(IntPtr db, delegate_profile func, object v)
        {
            if (_profile_hook != null)
            {
                // TODO maybe turn off the hook here, for now
                _profile_hook.free();
                _profile_hook = null;
            }

            if (func != null)
            {
                _profile_hook = new profile_hook_info(func, v);
                SQLite3RuntimeProvider.sqlite3_profile(db.ToInt64(), Marshal.GetFunctionPointerForDelegate(new callback_profile(profile_hook_bridge)).ToInt64(), _profile_hook.ptr.ToInt64());
            }
            else
            {
                SQLite3RuntimeProvider.sqlite3_profile(db.ToInt64(), IntPtr.Zero.ToInt64(), IntPtr.Zero.ToInt64());
            }
        }