Exemplo n.º 1
0
        public static ItemMetadataAdaptor CreateInstance(SyncId globalId, SyncId replicaId)
        {
            SynchronizationMetadataRow row    = new SynchronizationMetadataRow();
            ItemMetadataAdaptor        retVal = new ItemMetadataAdaptor(row);

            row.Id        = Guid.NewGuid();
            row.UniqueId  = globalId.GetSyncGlobalId().UniqueId;
            row.Prefix    = (long)globalId.GetSyncGlobalId().Prefix;
            row.ReplicaId = replicaId.GetGuidId();
            return(retVal);
        }
Exemplo n.º 2
0
        public static ItemMetadataAdaptor FindMetadataItemById(SyncId replicaId, SyncId globalId)
        {
            ItemMetadataAdaptor retVal   = null;
            FilterElement       filterEl = new AndBlockFilterElement();

            filterEl.ChildElements.Add(new FilterElement(SynchronizationMetadataRow.ColumnReplicaId, FilterElementType.Equal,
                                                         replicaId.GetGuidId()));
            filterEl.ChildElements.Add(new FilterElement(SynchronizationMetadataRow.ColumnUniqueId, FilterElementType.Equal,
                                                         globalId.GetSyncGlobalId().UniqueId));
            filterEl.ChildElements.Add(new FilterElement(SynchronizationMetadataRow.ColumnPrefix, FilterElementType.Equal,
                                                         (long)globalId.GetSyncGlobalId().Prefix));

            SynchronizationMetadataRow[] itemRows = SynchronizationMetadataRow.List(filterEl);
            if (itemRows.Length != 0)
            {
                retVal = new ItemMetadataAdaptor(itemRows[0]);
            }

            return(retVal);
        }