示例#1
0
        public void Apply(SessionConflictCallback conflictCallback, SessionTableFilterCallback tableFilterCallback, object clientData)
        {
            this.CheckDisposed();
            SQLiteSessionHelpers.CheckRawData(this.rawData);
            if (conflictCallback == null)
            {
                throw new ArgumentNullException("conflictCallback");
            }
            UnsafeNativeMethods.xSessionFilter   @delegate         = base.GetDelegate(tableFilterCallback, clientData);
            UnsafeNativeMethods.xSessionConflict _xSessionConflict = base.GetDelegate(conflictCallback, clientData);
            IntPtr zero = IntPtr.Zero;

            try
            {
                int num = 0;
                zero = SQLiteBytes.ToIntPtr(this.rawData, ref num);
                SQLiteErrorCode sQLiteErrorCode = UnsafeNativeMethods.sqlite3changeset_apply(base.GetIntPtr(), num, zero, @delegate, _xSessionConflict, IntPtr.Zero);
                if (sQLiteErrorCode != SQLiteErrorCode.Ok)
                {
                    throw new SQLiteException(sQLiteErrorCode, "sqlite3changeset_apply");
                }
            }
            finally
            {
                if (zero != IntPtr.Zero)
                {
                    SQLiteMemory.Free(zero);
                    zero = IntPtr.Zero;
                }
            }
        }
示例#2
0
 protected override void Dispose(bool disposing)
 {
     try
     {
         if (!this.disposed)
         {
             if (disposing)
             {
                 if (this.xFilter != null)
                 {
                     this.xFilter = null;
                 }
                 if (this.streamManager != null)
                 {
                     this.streamManager.Dispose();
                     this.streamManager = null;
                 }
             }
             if (this.session != IntPtr.Zero)
             {
                 UnsafeNativeMethods.sqlite3session_delete(this.session);
                 this.session = IntPtr.Zero;
             }
             base.Unlock();
         }
     }
     finally
     {
         base.Dispose(disposing);
         this.disposed = true;
     }
 }
        public void Apply(SessionConflictCallback conflictCallback, SessionTableFilterCallback tableFilterCallback, object clientData)
        {
            this.CheckDisposed();
            this.CheckInputStream();
            if (conflictCallback == null)
            {
                throw new ArgumentNullException("conflictCallback");
            }
            UnsafeNativeMethods.xSessionFilter   @delegate         = base.GetDelegate(tableFilterCallback, clientData);
            UnsafeNativeMethods.xSessionConflict _xSessionConflict = base.GetDelegate(conflictCallback, clientData);
            SQLiteErrorCode sQLiteErrorCode = UnsafeNativeMethods.sqlite3changeset_apply_strm(base.GetIntPtr(), this.inputStreamAdapter.GetInputDelegate(), IntPtr.Zero, @delegate, _xSessionConflict, IntPtr.Zero);

            if (sQLiteErrorCode != SQLiteErrorCode.Ok)
            {
                throw new SQLiteException(sQLiteErrorCode, "sqlite3changeset_apply_strm");
            }
        }
示例#4
0
 private UnsafeNativeMethods.xSessionFilter ApplyTableFilter(SessionTableFilterCallback callback, object clientData)
 {
     this.tableFilterCallback   = callback;
     this.tableFilterClientData = clientData;
     if (callback == null)
     {
         if (this.xFilter != null)
         {
             this.xFilter = null;
         }
         return(null);
     }
     if (this.xFilter == null)
     {
         this.xFilter = new UnsafeNativeMethods.xSessionFilter(this.Filter);
     }
     return(this.xFilter);
 }