ChangeUnitListFilterInfo constructeur (SyncIdFormatGroup, ICollection générique, Boolean)
Initialise une nouvelle instance de la classe ChangeUnitListFilterInfo qui contient le schéma du format d'ID spécifié, la collection des ID d'unité de modification qui indiquent quelles unités de modification sont incluses par ce filtre, ainsi qu'une valeur qui indique si le filtre s'applique à tous les éléments de l'étendue.
Espace de noms: Microsoft.Synchronization
Assembly: Microsoft.Synchronization (dans microsoft.synchronization.dll)
Syntaxe
'Déclaration
Public Sub New ( _
idFormats As SyncIdFormatGroup, _
changeUnitIds As ICollection(Of SyncId), _
appliesToAllItems As Boolean _
)
'Utilisation
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
)
Paramètres
- idFormats
Schéma du format d'ID du fournisseur.
- changeUnitIds
Collection des ID d'unité de modification qui indiquent quelles unités de modification sont incluses par ce filtre.
- appliesToAllItems
true lorsque le filtre s'applique à tous les éléments de l'étendue. Sinon, false.
Exemple
L'exemple suivant génère une liste d'ID d'unités de modification à inclure dans la synchronisation et utilise la liste d'ID d'unités de modification pour créer un objet ChangeUnitListFilterInfo. L'objet ChangeUnitListFilterInfo est passé à la méthode GetFilteredChangeBatch pour récupérer un lot de modifications filtrées du service de stockage des métadonnées.
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;
}
Voir aussi
Référence
Classe ChangeUnitListFilterInfo
Membres ChangeUnitListFilterInfo
Espace de noms Microsoft.Synchronization