当前位置: 首页>>代码示例>>C#>>正文


C# Replication.RemoteCheckpointDocID方法代码示例

本文整理汇总了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;
        }
开发者ID:pkdevboxy,项目名称:couchbase-lite-net,代码行数:22,代码来源:Database.cs

示例2: HasSameSettingsAs

 internal bool HasSameSettingsAs(Replication other)
 {
     return LocalDatabase == other.LocalDatabase &&
     IsPull == other.IsPull &&
     RemoteCheckpointDocID("").Equals(other.RemoteCheckpointDocID(""));
 }
开发者ID:Steven-Mark-Ford,项目名称:couchbase-lite-net,代码行数:6,代码来源:Replication.cs

示例3: AddReplication

        internal bool AddReplication(Replication replication)
        {
            lock (_allReplicatorsLocker) {
                if (AllReplications.All(x => x.RemoteCheckpointDocID() != replication.RemoteCheckpointDocID())) {
                    AllReplicators.Add(replication);
                    return true;
                }

                return false;

            }
        }
开发者ID:pkdevboxy,项目名称:couchbase-lite-net,代码行数:12,代码来源:Database.cs

示例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;
        }
开发者ID:jonfunkhouser,项目名称:couchbase-lite-net,代码行数:33,代码来源:Database.cs


注:本文中的Couchbase.Lite.Replication.RemoteCheckpointDocID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。