internal override void CreateCollation(string strCollation, SQLiteCollation func, SQLiteCollation func16) { int n = UnsafeNativeMethods.sqlite3_create_collation(_sql, ToUTF8(strCollation), 2, IntPtr.Zero, func16); if (n == 0) { UnsafeNativeMethods.sqlite3_create_collation(_sql, ToUTF8(strCollation), 1, IntPtr.Zero, func); } if (n > 0) { throw new SqliteException(n, SQLiteLastError()); } }
internal override IntPtr CreateCollation(string strCollation, SQLiteCollation func) { IntPtr nCookie; int n = UnsafeNativeMethods.sqlite3_create_collation_interop(_sql, ToUTF8(strCollation), 1, 0, func, out nCookie); if (n > 0) { throw new SQLiteException(n, SQLiteLastError()); } return(nCookie); }
internal override void CreateCollation(string strCollation, SQLiteCollation func, SQLiteCollation func16) { //int n = UnsafeNativeMethods.sqlite3_create_collation(_sql, ToUTF8(strCollation), 2, IntPtr.Zero, func16); //if (n == 0) //{ // UnsafeNativeMethods.sqlite3_create_collation(_sql, ToUTF8(strCollation), 1, IntPtr.Zero, func); //} //if (n > 0) //{ // throw new SqliteException(n, SQLiteLastError()); //} throw new NotImplementedException(); }
protected virtual void Dispose(bool disposing) { if (disposing) { foreach (KeyValuePair <long, AggregateData> pair in this._contextDataList) { IDisposable disposable = pair.Value._data as IDisposable; if (disposable != null) { disposable.Dispose(); } } this._contextDataList.Clear(); this._InvokeFunc = null; this._StepFunc = null; this._FinalFunc = null; this._CompareFunc = null; this._base = null; this._contextDataList = null; } }
/////////////////////////////////////////////////////////////////////////////////////////////// /// <summary> /// Placeholder for a user-defined disposal routine /// </summary> /// <param name="disposing">True if the object is being disposed explicitly</param> protected virtual void Dispose(bool disposing) { if (!disposed) { if (disposing) { //////////////////////////////////// // dispose managed resources here... //////////////////////////////////// IDisposable disp; foreach (KeyValuePair <IntPtr, AggregateData> kv in _contextDataList) { disp = kv.Value._data as IDisposable; if (disp != null) { disp.Dispose(); } } _contextDataList.Clear(); _contextDataList = null; _flags = SQLiteConnectionFlags.None; _InvokeFunc = null; _StepFunc = null; _FinalFunc = null; _CompareFunc = null; _base = null; } ////////////////////////////////////// // release unmanaged resources here... ////////////////////////////////////// disposed = true; } }
/// <summary> /// Placeholder for a user-defined disposal routine /// </summary> /// <param name="disposing">True if the object is being disposed explicitly</param> protected virtual void Dispose(bool disposing) { if (disposing) { IDisposable disp; foreach (KeyValuePair <long, AggregateData> kv in _contextDataList) { disp = kv.Value._data as IDisposable; if (disp != null) { disp.Dispose(); } } _contextDataList.Clear(); _InvokeFunc = null; _StepFunc = null; _FinalFunc = null; _CompareFunc = null; _base = null; _contextDataList = null; } }
internal abstract void CreateCollation(string strCollation, SQLiteCollation func, SQLiteCollation func16, IntPtr user_data);
/// <summary> /// Placeholder for a user-defined disposal routine /// </summary> /// <param name="disposing">True if the object is being disposed explicitly</param> protected virtual void Dispose(bool disposing) { if (disposing) { IDisposable disp; foreach (KeyValuePair<long, AggregateData> kv in _contextDataList) { disp = kv.Value._data as IDisposable; if (disp != null) disp.Dispose(); } _contextDataList.Clear(); _InvokeFunc = null; _StepFunc = null; _FinalFunc = null; _CompareFunc = null; _base = null; _contextDataList = null; } }
internal override void CreateCollation(string strCollation, SQLiteCollation func, SQLiteCollation func16) { int n = UnsafeNativeMethods.sqlite3_create_collation(_sql, ToUTF8(strCollation), 2, IntPtr.Zero, func16); if (n == 0) UnsafeNativeMethods.sqlite3_create_collation(_sql, ToUTF8(strCollation), 1, IntPtr.Zero, func); if (n > 0) throw new SqliteException(n, SQLiteLastError()); }
internal abstract IntPtr CreateCollation(string strCollation, SQLiteCollation func);
internal abstract SQLiteErrorCode CreateCollation(string strCollation, SQLiteCollation func, SQLiteCollation func16, bool @throw);
internal static extern int sqlite3_create_collation(IntPtr db, byte[] strName, int nType, IntPtr pvUser, SQLiteCollation func);
internal static extern int sqlite3_create_collation16_interop(IntPtr db, string strName, int nType, int nArgs, SQLiteCollation func, out IntPtr nCookie);
/////////////////////////////////////////////////////////////////////////////////////////////// /// <summary> /// Placeholder for a user-defined disposal routine /// </summary> /// <param name="disposing">True if the object is being disposed explicitly</param> protected virtual void Dispose(bool disposing) { if (!disposed) { if (disposing) { //////////////////////////////////// // dispose managed resources here... //////////////////////////////////// IDisposable disp; foreach (KeyValuePair<IntPtr, AggregateData> kv in _contextDataList) { disp = kv.Value._data as IDisposable; if (disp != null) disp.Dispose(); } _contextDataList.Clear(); _contextDataList = null; _flags = SQLiteConnectionFlags.None; _InvokeFunc = null; _StepFunc = null; _FinalFunc = null; _CompareFunc = null; _base = null; } ////////////////////////////////////// // release unmanaged resources here... ////////////////////////////////////// disposed = true; } }
internal override void CreateCollation(string strCollation, SQLiteCollation func, SQLiteCollation func16) { int errorCode = UnsafeNativeMethods.sqlite3_create_collation((IntPtr)this._sql, SQLiteConvert.ToUTF8(strCollation), 2, IntPtr.Zero, func16); if (errorCode == 0) { UnsafeNativeMethods.sqlite3_create_collation((IntPtr)this._sql, SQLiteConvert.ToUTF8(strCollation), 1, IntPtr.Zero, func); } if (errorCode > 0) { throw new SQLiteException(errorCode, this.SQLiteLastError()); } }
internal abstract void CreateCollation(string strCollation, SQLiteCollation func, SQLiteCollation func16);
internal static void BindFunction(SQLiteBase sqliteBase, SQLiteFunctionAttribute functionAttribute, SQLiteFunction function, SQLiteConnectionFlags flags) { SQLiteCallback sQLiteCallback; SQLiteCallback sQLiteCallback1; SQLiteFinalCallback sQLiteFinalCallback; SQLiteCollation sQLiteCollation; SQLiteCollation sQLiteCollation1; if (sqliteBase == null) { throw new ArgumentNullException("sqliteBase"); } if (functionAttribute == null) { throw new ArgumentNullException("functionAttribute"); } if (function == null) { throw new ArgumentNullException("function"); } FunctionType funcType = functionAttribute.FuncType; function._base = sqliteBase; function._flags = flags; SQLiteFunction sQLiteFunction = function; if (funcType == FunctionType.Scalar) { sQLiteCallback = new SQLiteCallback(function.ScalarCallback); } else { sQLiteCallback = null; } sQLiteFunction._InvokeFunc = sQLiteCallback; SQLiteFunction sQLiteFunction1 = function; if (funcType == FunctionType.Aggregate) { sQLiteCallback1 = new SQLiteCallback(function.StepCallback); } else { sQLiteCallback1 = null; } sQLiteFunction1._StepFunc = sQLiteCallback1; SQLiteFunction sQLiteFunction2 = function; if (funcType == FunctionType.Aggregate) { sQLiteFinalCallback = new SQLiteFinalCallback(function.FinalCallback); } else { sQLiteFinalCallback = null; } sQLiteFunction2._FinalFunc = sQLiteFinalCallback; SQLiteFunction sQLiteFunction3 = function; if (funcType == FunctionType.Collation) { sQLiteCollation = new SQLiteCollation(function.CompareCallback); } else { sQLiteCollation = null; } sQLiteFunction3._CompareFunc = sQLiteCollation; SQLiteFunction sQLiteFunction4 = function; if (funcType == FunctionType.Collation) { sQLiteCollation1 = new SQLiteCollation(function.CompareCallback16); } else { sQLiteCollation1 = null; } sQLiteFunction4._CompareFunc16 = sQLiteCollation1; string name = functionAttribute.Name; if (funcType == FunctionType.Collation) { sqliteBase.CreateCollation(name, function._CompareFunc, function._CompareFunc16, true); return; } bool flag = function is SQLiteFunctionEx; sqliteBase.CreateFunction(name, functionAttribute.Arguments, flag, function._InvokeFunc, function._StepFunc, function._FinalFunc, true); }
/// <summary> /// Disposes of any active contextData variables that were not automatically cleaned up. Sometimes this can happen if /// someone closes the connection while a DataReader is open. /// </summary> public void Dispose() { Dispose(true); IDisposable disp; foreach (KeyValuePair<long, object> kv in _contextDataList) { disp = kv.Value as IDisposable; if (disp != null) disp.Dispose(); } _contextDataList.Clear(); _InvokeFunc = null; _StepFunc = null; _FinalFunc = null; _CompareFunc = null; _base = null; _contextDataList = null; GC.SuppressFinalize(this); }
internal override void CreateCollation(string strCollation, SQLiteCollation func, SQLiteCollation func16) { SQLiteErrorCode n = UnsafeNativeMethods.sqlite3_create_collation(_sql, ToUTF8(strCollation), 2, IntPtr.Zero, func16); if (n == SQLiteErrorCode.Ok) n = UnsafeNativeMethods.sqlite3_create_collation(_sql, ToUTF8(strCollation), 1, IntPtr.Zero, func); if (n != SQLiteErrorCode.Ok) throw new SQLiteException(n, GetLastError()); }
internal override IntPtr CreateCollation(string strCollation, SQLiteCollation func) { IntPtr nCookie; int n = UnsafeNativeMethods.sqlite3_create_collation16_interop(_sql, strCollation, 4, 0, func, out nCookie); if (n > 0) throw new SQLiteException(n, SQLiteLastError()); return nCookie; }