コード例 #1
0
 public static C4Replicator *c4repl_new(C4Database *db, C4Address remoteAddress, string remoteDatabaseName,
                                        C4Database *otherDb, C4ReplicatorMode push, C4ReplicatorMode pull, ReplicatorStateChangedCallback onStateChanged,
                                        C4Error *err)
 {
     return(Native.c4repl_new(db, remoteAddress, remoteDatabaseName, otherDb, push, pull, onStateChanged.NativeCallback,
                              onStateChanged.NativeContext, err));
 }
コード例 #2
0
 public C4ReplicatorParameters(C4ReplicatorMode push, C4ReplicatorMode pull, C4Slice optionsFleece, void *context)
 {
     this.push         = push;
     this.pull         = pull;
     optionsDictFleece = optionsFleece;
     validationFunc    = Marshal.GetFunctionPointerForDelegate(ReplicatorParameters.NativeValidateFunction);
     onStatusChanged   = Marshal.GetFunctionPointerForDelegate(ReplicatorParameters.NativeChangedCallback);
     onDocumentError   = Marshal.GetFunctionPointerForDelegate(ReplicatorParameters.NativeErrorCallback);
     callbackContext   = context;
 }
コード例 #3
0
 public ReplicatorParameters(C4ReplicatorMode push, C4ReplicatorMode pull, IDictionary<string, object> options,
     Func<string, IntPtr, object, bool> validateFunction, Action<bool, string, C4Error, bool, object> errorCallback,
     Action<C4ReplicatorStatus, object> stateChangedCallback, object context)
 {
     var nextId = Interlocked.Increment(ref _NextID);
     _id = nextId;
     _validateFunction = validateFunction;
     _errorCallback = errorCallback;
     _stateChangedCallback = stateChangedCallback;
     _context = context;
     _nativeContext = (void*)nextId;
     C4Params = new C4ReplicatorParameters(push, pull, (C4Slice)options.FLEncode(), _nativeContext);
     _StaticMap[_id] = this;
 }
コード例 #4
0
 public static extern C4Replicator *c4repl_new(C4Database *db, C4Address remoteAddress, C4Slice remoteDatabaseName, C4Database *otherLocalDB, C4ReplicatorMode push, C4ReplicatorMode pull, C4ReplicatorStateChangedCallback onStateChanged, void *callbackContext, C4Error *err);
コード例 #5
0
 public static C4Replicator *c4repl_new(C4Database *db, C4Address remoteAddress, string remoteDatabaseName, C4Database *otherLocalDB, C4ReplicatorMode push, C4ReplicatorMode pull, C4ReplicatorStateChangedCallback onStateChanged, void *callbackContext, C4Error *err)
 {
     using (var remoteDatabaseName_ = new C4String(remoteDatabaseName)) {
         return(NativeRaw.c4repl_new(db, remoteAddress, remoteDatabaseName_.AsC4Slice(), otherLocalDB, push, pull, onStateChanged, callbackContext, err));
     }
 }