private void Dispose(bool finalizing) { DispatchQueue.DispatchSync(() => { if (_disposed) { return; } if (!finalizing) { _nativeParams?.Dispose(); if (Status.Activity != ReplicatorActivityLevel.Stopped) { var newStatus = new ReplicatorStatus(ReplicatorActivityLevel.Stopped, Status.Progress, null); _statusChanged.Fire(this, new ReplicatorStatusChangedEventArgs(newStatus)); Status = newStatus; } } Stop(); Native.c4repl_free(_repl); _repl = null; _disposed = true; }); }
private void OnStatusChanged(ReplicatorStatusMessage message) { _status = message.Status; switch (message.Status.Activity) { case ReplicatorActivityLevel.Offline: _imageStatusReplication = "antenna_gray.png"; break; case ReplicatorActivityLevel.Connecting: _imageStatusReplication = "import_export.png"; break; case ReplicatorActivityLevel.Busy: _imageStatusReplication = "cached.png"; break; case ReplicatorActivityLevel.Idle: _imageStatusReplication = "antenna_green.png"; break; case ReplicatorActivityLevel.Stopped: _imageStatusReplication = "puce_gray_black.png"; break; } }
private void UpdateStateProperties(C4ReplicatorStatus state) { Exception error = null; if (state.error.code > 0) { error = CouchbaseException.Create(state.error); } _rawStatus = state; var level = (ReplicatorActivityLevel)state.level; var progress = new ReplicatorProgress(state.progress.unitsCompleted, state.progress.unitsTotal); Status = new ReplicatorStatus(level, progress, error); WriteLog.To.Sync.I(Tag, $"{this} is {state.level}, progress {state.progress.unitsCompleted}/{state.progress.unitsTotal}"); }
internal ReplicatorStatusChangedEventArgs(ReplicatorStatus status) { Status = status; }
public ReplicatorStatusMessage(Couchbase.Lite.Sync.ReplicatorStatus status, string le) { Status = status; LastError = le; }