IFilteredReplicaNotifyingChangeApplierTarget.GetNewMoveInItems 方法

获取一个项 ID 列表,这些项 ID 标识包含在筛选器中但不包含在指定知识中的项。

命名空间: Microsoft.Synchronization
程序集: Microsoft.Synchronization(在 microsoft.synchronization.dll 中)

语法

声明
Function GetNewMoveInItems ( _
    baseKnowledge As SyncKnowledge _
) As IEnumerator(Of SyncId)
用法
Dim instance As IFilteredReplicaNotifyingChangeApplierTarget
Dim baseKnowledge As SyncKnowledge
Dim returnValue As IEnumerator(Of SyncId)

returnValue = instance.GetNewMoveInItems(baseKnowledge)
IEnumerator<SyncId> GetNewMoveInItems (
    SyncKnowledge baseKnowledge
)
IEnumerator<SyncId^>^ GetNewMoveInItems (
    SyncKnowledge^ baseKnowledge
)
IEnumerator<SyncId> GetNewMoveInItems (
    SyncKnowledge baseKnowledge
)
function GetNewMoveInItems (
    baseKnowledge : SyncKnowledge
) : IEnumerator<SyncId>

参数

  • baseKnowledge
    返回的项 ID 列表,这些项 ID 标识包含在筛选器中但不包含在此知识中的项。

返回值

项 ID 列表,这些项 ID 标识包含在筛选器中但不包含在 baseKnowledge 中的项。

备注

此方法由变更应用方用于确定在记录 baseKnowledge 指定的知识后,哪些项已移入筛选器。例如,对存储媒体文件的副本进行筛选,使其仅存储级别为三星或更高级别的文件的数据。记录 baseKnowledge 后,一个文件被评为 2 星。用户将该文件的评分改为四星。该文件移入筛选器中并且必须包含在此方法返回的列表中。

示例

以下示例枚举元数据存储区中的所有项。当某个项位于用于同步的筛选器中以及与该筛选器相关的项的移动版本不包含在指定的基础知识中时,将向新移入项的列表中添加该项。

Public Function GetNewMoveInItems(ByVal baseKnowledge As SyncKnowledge) As IEnumerator(Of SyncId) Implements IFilteredReplicaNotifyingChangeApplierTarget.GetNewMoveInItems
    Dim newMoveInIdList As New List(Of SyncId)()
    Dim allItems As IEnumerable(Of ItemMetadata) = _ContactStore.ContactReplicaMetadata.GetAllItems(False)
    Dim mappedBaseKnowledge As SyncKnowledge = _ContactStore.ContactReplicaMetadata.GetKnowledge().MapRemoteKnowledgeToLocal(baseKnowledge)
    For Each itemMeta As ItemMetadata In allItems
        Dim filterChange As FilterChange = _ContactStore.GetTrackedFilterMetadata(itemMeta, _filterForSync)
        If filterChange.IsMoveIn Then
            If Not mappedBaseKnowledge.Contains(_ContactStore.ContactReplicaMetadata.ReplicaId, itemMeta.GlobalId, filterChange.MoveVersion) Then
                newMoveInIdList.Add(itemMeta.GlobalId)
            End If
        End If
    Next
    Return newMoveInIdList.GetEnumerator()
End Function
public IEnumerator<SyncId>  GetNewMoveInItems(SyncKnowledge baseKnowledge)
{
     List<SyncId> newMoveInIdList = new List<SyncId>();
    IEnumerable<ItemMetadata> allItems = _ContactStore.ContactReplicaMetadata.GetAllItems(false);
    SyncKnowledge mappedBaseKnowledge = _ContactStore.ContactReplicaMetadata.GetKnowledge().MapRemoteKnowledgeToLocal(baseKnowledge);
    foreach (ItemMetadata itemMeta in allItems)
    {
        FilterChange filterChange = _ContactStore.GetTrackedFilterMetadata(itemMeta, _filterForSync);
        if (filterChange.IsMoveIn)
        {
            if (!mappedBaseKnowledge.Contains(_ContactStore.ContactReplicaMetadata.ReplicaId, itemMeta.GlobalId, filterChange.MoveVersion))
            {
                newMoveInIdList.Add(itemMeta.GlobalId);
            }
        }
    }
    return newMoveInIdList.GetEnumerator();
}

请参阅

参考

IFilteredReplicaNotifyingChangeApplierTarget 接口
IFilteredReplicaNotifyingChangeApplierTarget 成员
Microsoft.Synchronization 命名空间