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())); }); }
static Database() { _DbObserverCallback = DbObserverCallback; _DocObserverCallback = DocObserverCallback; FLSliceExtensions.RegisterFLEncodeExtension(FLValueConverter.FLEncode); }
public static DatabaseObserver c4dbobs_create(C4Database *db, DatabaseObserverCallback callback, object context) { return(new DatabaseObserver(db, callback, context)); }