ChangeUnitListFilterInfo Constructor (SyncIdFormatGroup, ICollection(SyncId), Boolean)
Inicializa una nueva instancia de la clase ChangeUnitListFilterInfo que contiene el esquema de formato de identificador especificado, la colección de identificadores de unidad de cambio que indica qué unidades de cambio incluye este filtro y un valor que indica si el filtro se aplica a todos los elementos del ámbito.
Espacio de nombres: Microsoft.Synchronization
Ensamblado: Microsoft.Synchronization (en Microsoft.Synchronization.dll)
Sintaxis
'Declaración
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
)
new :
idFormats:SyncIdFormatGroup *
changeUnitIds:ICollection<SyncId> *
appliesToAllItems:bool -> ChangeUnitListFilterInfo
public function ChangeUnitListFilterInfo(
idFormats : SyncIdFormatGroup,
changeUnitIds : ICollection<SyncId>,
appliesToAllItems : boolean
)
Parámetros
- idFormats
Tipo: Microsoft.Synchronization. . :: . .SyncIdFormatGroup
Esquema de formato de identificador del proveedor.
- changeUnitIds
Tipo: System.Collections.Generic. . :: . .ICollection< (Of < ( <'SyncId> ) > ) >
Colección de identificadores de unidad de cambio que indica qué unidades de cambio incluye este filtro.
- appliesToAllItems
Tipo: System. . :: . .Boolean
true cuando el filtro se aplica a todos los elementos del ámbito. En caso contrario, false.
Excepciones
Excepción | Condición |
---|---|
ArgumentNullException | idFormats o changeUnitIds es un valor null Nothing nullptr unit es una referencia NULL (Nothing en Visual Basic). . |
ArgumentException | changeUnitIds está vacío. |
Ejemplos
En el ejemplo siguiente se crea una lista de los identificadores de unidad de cambio que se incluyen en la sincronización y se usa la citada lista para crear un objeto ChangeUnitListFilterInfo. El objeto ChangeUnitListFilterInfo se pasa al método GetFilteredChangeBatch para recuperar un lote de cambios filtrado de Metadata Storage Service.
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;
}
Vea también
Referencia
ChangeUnitListFilterInfo Clase
ChangeUnitListFilterInfo Miembros