取得項目識別碼的清單,這些項目識別碼會識別在篩選中,而且不包含在指定之知識中的項目。
命名空間: 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
傳回的項目識別碼清單會識別在篩選中,而且不包含在此知識中的項目。
傳回值
項目識別碼的清單,這些項目識別碼會識別在篩選中,而且不包含在 baseKnowledge 中的項目。
備註
這個方法是由變更套用者用來判斷記錄 baseKnowledge 指定的知識之後,已移入篩選中的項目。例如,系統會將儲存媒體檔案的複寫篩選為僅儲存評比為三顆星以上之資料的檔案。記錄 baseKnowledge 時,檔案評比為兩顆星。使用者會將檔案的評比變更為四顆星。檔案就會移入篩選,而且必須包含在從此方法傳回的清單中。
範例
下列範例會列舉中繼資料存放區中的所有項目。如果某個項目是在同步處理使用的篩選中,便會將此項目加入到新移入項目的清單,而此項目相對於篩選的移動版本則不會包含在所指定的基本知識中。
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 命名空間