/// <summary> /// Открывает хранилище метаданных реплики по ее replicaId. /// </summary> /// <param name="replicaId">The replica id.</param> /// <returns></returns> public static ReplicaMetadataAdaptor CreateInstance(SyncId replicaId) { ReplicaMetadataAdaptor retVal = null; SynchronizationReplicaRow row = null; row = new SynchronizationReplicaRow(replicaId.GetGuidId()); retVal = new ReplicaMetadataAdaptor(row); return(retVal); }
/// <summary> /// Создает новое хранилище метаданных реплики /// </summary> /// <param name="replicaId">The replica id.</param> /// <param name="idFormats">The id formats.</param> /// <returns></returns> public static ReplicaMetadataAdaptor CreateInstance(SyncId replicaId, SyncIdFormatGroup idFormats) { SynchronizationReplicaRow row = new SynchronizationReplicaRow(); row.TickCount = 1; ReplicaMetadataAdaptor retVal = new ReplicaMetadataAdaptor(row); retVal._replicaRow.PrimaryKeyId = replicaId.GetGuidId(); retVal.ReplicaKeyMap = new ReplicaKeyMap(idFormats, replicaId); retVal.CurrentKnowledge = new SyncKnowledge(idFormats, retVal.ReplicaKeyMap, (ulong)retVal.TickCount); retVal.ForgottenKnowledge = new ForgottenKnowledge(idFormats, retVal.CurrentKnowledge); return(retVal); }
/// <summary> /// Открывает хранилище метаданных по principalId /// </summary> /// <param name="pricipalId">The pricipal id.</param> /// <returns></returns> public static ReplicaMetadataAdaptor CreateInstance(int pricipalId) { if (pricipalId == -1) { throw new ArgumentException("principalId"); } ReplicaMetadataAdaptor retVal = null; FilterElement filterEl = new FilterElement(SynchronizationReplicaRow.ColumnPrincipalId, FilterElementType.Equal, pricipalId); foreach (SynchronizationReplicaRow replicaRow in SynchronizationReplicaRow.List(filterEl)) { retVal = new ReplicaMetadataAdaptor(replicaRow); break; } return(retVal); }