Partilhar via


Construtor ChangeUnitListFilterInfo (SyncIdFormatGroup, ICollection genérico, Boolean)

Inicializa uma nova instância da classe ChangeUnitListFilterInfo que contém o esquema do formato da ID especificado, a coleção de IDs da unidade de alteração que indicam quais unidades de alteração são incluídas por esse filtro e um valor que indica se o filtro se aplica a todos os itens no escopo.

Namespace: Microsoft.Synchronization
Assembly: Microsoft.Synchronization (em microsoft.synchronization.dll)

Sintaxe

'Declaração
Public Sub New ( _
    idFormats As SyncIdFormatGroup, _
    changeUnitIds As ICollection(Of SyncId), _
    appliesToAllItems As Boolean _
)
'Uso
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
)

Parâmetros

  • idFormats
    O esquema de formato da ID do provedor.
  • changeUnitIds
    A coleção de IDs da unidade de alteração que indicam quais unidades de alteração são incluídas por esse filtro.
  • appliesToAllItems
    true quando o filtro se aplica a todos os itens no escopo. Caso contrário, false.

Exemplo

O exemplo a seguir cria uma lista de IDs de unidades de alteração que devem ser incluídas na sincronização e usa a lista para criar um objeto ChangeUnitListFilterInfo. O objeto ChangeUnitListFilterInfo é passado para o método GetFilteredChangeBatch a fim de recuperar um lote de alterações filtrado do serviço de armazenamento de metadados.

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;
}

Consulte também

Referência

Classe ChangeUnitListFilterInfo
Membros ChangeUnitListFilterInfo
Namespace Microsoft.Synchronization