다음을 통해 공유


ItemListFilterInfo 생성자 (SyncIdFormatGroup)

지정된 ID 형식 스키마를 포함하는 ItemListFilterInfo 클래스의 새 인스턴스를 초기화합니다.

네임스페이스: Microsoft.Synchronization
어셈블리: microsoft.synchronization.dll의 Microsoft.Synchronization

구문

‘선언
Public Sub New ( _
    idFormats As SyncIdFormatGroup _
)
‘사용 방법
Dim idFormats As SyncIdFormatGroup

Dim instance As New ItemListFilterInfo(idFormats)
public ItemListFilterInfo (
    SyncIdFormatGroup idFormats
)
public:
ItemListFilterInfo (
    SyncIdFormatGroup^ idFormats
)
public ItemListFilterInfo (
    SyncIdFormatGroup idFormats
)
public function ItemListFilterInfo (
    idFormats : SyncIdFormatGroup
)

매개 변수

  • idFormats
    공급자의 ID 형식 스키마입니다.

예제

다음 예제에서는 ItemListFilterInfo 개체를 만들고 GetFilteredChangeBatch를 사용하여 ReplicaMetadata.ItemFilterCallback 구현과 함께 이 개체를 통해 필터링된 일괄 변경 내용을 검색합니다. ReplicaMetadata.ItemFilterCallback 구현도 포함됩니다.

Public Overrides Function GetChangeBatch(ByVal batchSize As UInteger, ByVal destinationKnowledge As SyncKnowledge, ByRef changeDataRetriever As Object) As ChangeBatch
    ' Return this object as the IChangeDataRetriever object that is called to retrieve item data.
    changeDataRetriever = Me

    ' Use the metadata storage service to get a batch of changes.
    Dim retrievedBatch As ChangeBatch
    If _isFiltered Then
        ' If a filter is set, get a filtered change batch from the metadata storage service.
        ' The BirthdateFilterCallback method indicates whether an item passes the filter.
        Dim filterInfo As New ItemListFilterInfo(IdFormats)
        retrievedBatch = _ContactStore.ContactReplicaMetadata.GetFilteredChangeBatch(batchSize, destinationKnowledge, filterInfo, AddressOf BirthdateFilterCallback)
    Else
        retrievedBatch = _ContactStore.ContactReplicaMetadata.GetChangeBatch(batchSize, destinationKnowledge)
    End If

    Return retrievedBatch
End Function
Public Function BirthdateFilterCallback(ByVal itemMeta As ItemMetadata) As Boolean
    ' An item passes the filter only if its birthdate field is less than the maximum birthdate
    ' specified by the filter.
    Return (_ContactStore.ContactList(itemMeta.GlobalId).Birthdate < _maxBirthdateFilter)
End Function
public override ChangeBatch GetChangeBatch(uint batchSize, SyncKnowledge destinationKnowledge, out object changeDataRetriever)
{
    // Return this object as the IChangeDataRetriever object that is called to retrieve item data.
    changeDataRetriever = this;

    // Use the metadata storage service to get a batch of changes.
    ChangeBatch retrievedBatch;
    if (_isFiltered)
    {
        // If a filter is set, get a filtered change batch from the metadata storage service.
        // The BirthdateFilterCallback method indicates whether an item passes the filter.
        ItemListFilterInfo filterInfo = new ItemListFilterInfo(IdFormats);
        retrievedBatch = _ContactStore.ContactReplicaMetadata.GetFilteredChangeBatch(batchSize, destinationKnowledge,
            filterInfo, BirthdateFilterCallback);
    }
    else
    {
        retrievedBatch = _ContactStore.ContactReplicaMetadata.GetChangeBatch(batchSize, destinationKnowledge);
    }

    return retrievedBatch;
}
public bool BirthdateFilterCallback(ItemMetadata itemMeta)
{
    // An item passes the filter only if its birthdate field is less than the maximum birthdate
    // specified by the filter.
    return (_ContactStore.ContactList[itemMeta.GlobalId].Birthdate < _maxBirthdateFilter);
}

참고 항목

참조

ItemListFilterInfo 클래스
ItemListFilterInfo 멤버
Microsoft.Synchronization 네임스페이스