IFilteredReplicaNotifyingChangeApplierTarget.GetNewMoveInItems メソッド

フィルターに含まれている項目のうち、指定したナレッジに含まれていない項目を示す項目 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 の一覧。

戻り値

フィルターに含まれている項目のうち、baseKnowledge に含まれていない項目を示す項目 ID の一覧。

解説

このメソッドは、変更適用元で、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 名前空間