다음을 통해 공유


ChangeUnitListFilterInfo 생성자 (SyncIdFormatGroup, 제네릭 ICollection, Boolean)

지정된 ID 형식 스키마, 이 필터에 포함되는 변경 단위를 나타내는 변경 단위 ID의 컬렉션 및 필터가 범위의 모든 항목에 적용되는지 여부를 나타내는 값을 포함하는 ChangeUnitListFilterInfo 클래스의 새 인스턴스를 초기화합니다.

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

구문

‘선언
Public Sub New ( _
    idFormats As SyncIdFormatGroup, _
    changeUnitIds As ICollection(Of SyncId), _
    appliesToAllItems As Boolean _
)
‘사용 방법
Dim idFormats As SyncIdFormatGroup
Dim changeUnitIds As ICollection(Of SyncId)
Dim appliesToAllItems As Boolean

Dim instance As New ChangeUnitListFilterInfo(idFormats, changeUnitIds, appliesToAllItems)
public ChangeUnitListFilterInfo (
    SyncIdFormatGroup idFormats,
    ICollection<SyncId> changeUnitIds,
    bool appliesToAllItems
)
public:
ChangeUnitListFilterInfo (
    SyncIdFormatGroup^ idFormats, 
    ICollection<SyncId^>^ changeUnitIds, 
    bool appliesToAllItems
)
public ChangeUnitListFilterInfo (
    SyncIdFormatGroup idFormats, 
    ICollection<SyncId> changeUnitIds, 
    boolean appliesToAllItems
)
public function ChangeUnitListFilterInfo (
    idFormats : SyncIdFormatGroup, 
    changeUnitIds : ICollection<SyncId>, 
    appliesToAllItems : boolean
)

매개 변수

  • idFormats
    공급자의 ID 형식 스키마입니다.
  • changeUnitIds
    이 필터에 포함되는 변경 단위를 나타내는 변경 단위 ID의 컬렉션입니다.
  • appliesToAllItems
    필터가 범위의 모든 항목에 적용되면 true이고, 그렇지 않으면 false입니다.

예제

다음 예제에서는 동기화에 포함할 변경 단위 ID 목록을 만들고 이 목록을 사용하여 ChangeUnitListFilterInfo 개체를 만듭니다. ChangeUnitListFilterInfo 개체는 GetFilteredChangeBatch 메서드에 전달되어 메타데이터 저장소 서비스에서 필터링된 일괄 변경 단위를 검색합니다.

Public Sub SetContactFieldsToInclude(ByVal includedFields As Contact.ChangeUnitFields())
    ' Translate the array of fields to a list of IDs.
    _includedChangeUnits = New List(Of SyncId)(includedFields.Length)
    For iField As Integer = 0 To includedFields.Length - 1
        _includedChangeUnits.Add(New SyncId(CByte(includedFields(iField))))
    Next

    _isFiltered = True
End Sub
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

    Dim retrievedBatch As ChangeBatch
    If _isFiltered Then
        ' Use the metadata storage service to get a filtered batch of changes.
        Dim filterInfo As New ChangeUnitListFilterInfo(IdFormats, _includedChangeUnits, True)
        retrievedBatch = _ContactStore.ContactReplicaMetadata.GetFilteredChangeBatch(batchSize, destinationKnowledge, filterInfo, Nothing)
    Else
        ' Use the metadata storage service to get a batch of changes.
        retrievedBatch = _ContactStore.ContactReplicaMetadata.GetChangeBatch(batchSize, destinationKnowledge)
    End If

    Return retrievedBatch
End Function
public void SetContactFieldsToInclude(Contact.ChangeUnitFields[] includedFields)
{
    // Translate the array of fields to a list of IDs.
    _includedChangeUnits = new List<SyncId>(includedFields.Length);
    for (int iField = 0; iField < includedFields.Length; iField++)
    {
        _includedChangeUnits.Add(new SyncId((byte)includedFields[iField]));
    }

    _isFiltered = true;
}
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;

    ChangeBatch retrievedBatch;
    if (_isFiltered)
    {
        // Use the metadata storage service to get a filtered batch of changes.
        ChangeUnitListFilterInfo filterInfo = new ChangeUnitListFilterInfo(IdFormats, _includedChangeUnits, true);
        retrievedBatch = _ContactStore.ContactReplicaMetadata.GetFilteredChangeBatch(batchSize, destinationKnowledge,
            filterInfo, null);
    }
    else
    {
        // Use the metadata storage service to get a batch of changes.
        retrievedBatch = _ContactStore.ContactReplicaMetadata.GetChangeBatch(batchSize, destinationKnowledge);
    }
    
    return retrievedBatch;
}

참고 항목

참조

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