Пример #1
0
        public DatabaseObserver(C4Database *database, DatabaseObserverCallback callback, object context)
        {
            _context        = context;
            _callback       = callback;
            _nativeCallback = DbObserverCallback;
            var id = Guid.NewGuid();

            _id       = GCHandle.Alloc(id, GCHandleType.Pinned);
            _observer = (long)LiteCoreBridge.Check(err => {
                _ObserverMap[id] = this;
                return(Native.c4dbobs_create(database, _nativeCallback, GCHandle.ToIntPtr(_id).ToPointer()));
            });
        }
Пример #2
0
 static Database()
 {
     _DbObserverCallback  = DbObserverCallback;
     _DocObserverCallback = DocObserverCallback;
     FLSliceExtensions.RegisterFLEncodeExtension(FLValueConverter.FLEncode);
 }
Пример #3
0
 public static DatabaseObserver c4dbobs_create(C4Database *db, DatabaseObserverCallback callback, object context)
 {
     return(new DatabaseObserver(db, callback, context));
 }