本文整理汇总了C#中Couchbase.Lite.Replication.RemoteCheckpointDocID方法的典型用法代码示例。如果您正苦于以下问题:C# Replication.RemoteCheckpointDocID方法的具体用法?C# Replication.RemoteCheckpointDocID怎么用?C# Replication.RemoteCheckpointDocID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Couchbase.Lite.Replication
的用法示例。
在下文中一共展示了Replication.RemoteCheckpointDocID方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddActiveReplication
internal bool AddActiveReplication(Replication replication)
{
if (ActiveReplicators == null) {
Log.W(TAG, "ActiveReplicators is null, so replication will not be added");
return false;
}
if (ActiveReplicators.All(x => x.RemoteCheckpointDocID() != replication.RemoteCheckpointDocID())) {
ActiveReplicators.Add(replication);
} else {
return false;
}
replication.Changed += (sender, e) => {
if (e.Source != null && !e.Source.IsRunning && ActiveReplicators != null)
{
ActiveReplicators.Remove(e.Source);
}
};
return true;
}
示例2: HasSameSettingsAs
internal bool HasSameSettingsAs(Replication other)
{
return LocalDatabase == other.LocalDatabase &&
IsPull == other.IsPull &&
RemoteCheckpointDocID("").Equals(other.RemoteCheckpointDocID(""));
}
示例3: AddReplication
internal bool AddReplication(Replication replication)
{
lock (_allReplicatorsLocker) {
if (AllReplications.All(x => x.RemoteCheckpointDocID() != replication.RemoteCheckpointDocID())) {
AllReplicators.Add(replication);
return true;
}
return false;
}
}
示例4: AddActiveReplication
internal bool AddActiveReplication(Replication replication)
{
if(replication == null) {
return false;
}
var activeReplicators = default(IList<Replication>);
if(!ActiveReplicators.AcquireTemp(out activeReplicators)) {
Log.To.Database.W(TAG, "{0} ActiveReplicators is null, so replication will not be added");
return false;
}
lock(_activeReplicatorsLocker) {
if(activeReplicators.All(x => x != null && x.RemoteCheckpointDocID() != replication.RemoteCheckpointDocID())) {
activeReplicators.Add(replication);
} else {
return false;
}
}
replication.Changed += (sender, e) =>
{
if(e.ReplicationStateTransition != null && (e.ReplicationStateTransition.Trigger == ReplicationTrigger.StopGraceful || e.ReplicationStateTransition.Trigger == ReplicationTrigger.StopImmediate)) {
if(ActiveReplicators.AcquireTemp(out activeReplicators)) {
lock(_activeReplicatorsLocker) {
activeReplicators.Remove(e.Source);
}
}
}
};
return true;
}