FilterChange Clase

Representa información sobre un cambio que hace que un elemento entre en un filtro o salga de él.

Espacio de nombres:  Microsoft.Synchronization
Ensamblado:  Microsoft.Synchronization (en Microsoft.Synchronization.dll)

Sintaxis

'Declaración
Public Class FilterChange
'Uso
Dim instance As FilterChange
public class FilterChange
public ref class FilterChange
type FilterChange =  class end
public class FilterChange

Notas

Un cambio puede hacer que un elemento entre en un filtro o salga de él. Por ejemplo, los elementos contienen un campo state y un filtro excluye cualquier elemento cuyo campo state sea "Washington". Cuando un elemento con state igual a "Washington" cambia para que state sea "Oregón", el elemento pasa al filtro.

Las propiedades de este objeto se pueden interpretar de acuerdo con la tabla siguiente.

Valor de IsMoveIn

Valor de MoveVersion

Significado

true

Versión de creación del elemento.

El elemento ha estado en el filtro desde que se creó.

true

Versión que no es la de creación del elemento.

El elemento entró en el filtro cuando se realizó el cambio con la versión de MoveVersion.

false

Establecido en 0.

El elemento no ha estado en el filtro desde que se inició el seguimiento del filtro.

false

Una versión distinta de 0.

El elemento salió del filtro cuando se realizó el cambio con la versión de MoveVersion.

Ejemplos

En el ejemplo siguiente se agrega información de cambio de filtro a un objeto ItemChange cuando la versión de movimiento para el elemento respecto al filtro no está contenida en el conocimiento de destino.

Public Sub AddFilterChanges(ByVal filterKeyMap As FilterKeyMap, ByVal itemMeta As ItemMetadata, ByVal destKnowledge As SyncKnowledge, ByVal itemChange As ItemChange)
    For filterKey As Integer = 0 To filterKeyMap.Count - 1
        ' Find the filter in the list of all filters tracked by this replica.
        Dim iFilter As Integer = 0
        While iFilter < _trackedFilters.Count
            If filterKeyMap(filterKey).IsIdentical(_trackedFilters(iFilter)) Then
                Exit While
            End If
            iFilter += 1
        End While

        ' Get the filter information for the item and add it to the ItemChange object.
        Dim moveVersion As SyncVersion = GetMoveVersion(itemMeta, iFilter)

        ' Only return a filter change if the destination knowledge does not contain the version of the 
        ' last move that occurred in relation to the specified filter.
        Dim filterChange As FilterChange = Nothing
        If Not destKnowledge.Contains(ContactReplicaMetadata.ReplicaId, itemMeta.GlobalId, moveVersion) Then
            filterChange = New FilterChange(GetIsInFilter(itemMeta, iFilter), moveVersion)
            itemChange.AddFilterChange(CUInt(filterKey), filterChange)
        End If
    Next
End Sub
public void AddFilterChanges(FilterKeyMap filterKeyMap, ItemMetadata itemMeta, SyncKnowledge destKnowledge,
    ItemChange itemChange)
{
    for (int filterKey = 0; filterKey < filterKeyMap.Count; filterKey++)
    {
        // Find the filter in the list of all filters tracked by this replica.
        int iFilter = 0;
        for (; iFilter < _trackedFilters.Count; iFilter++)
        {
            if (filterKeyMap[filterKey].IsIdentical(_trackedFilters[iFilter]))
            {
                break;
            }
        }

        // Get the filter information for the item and add it to the ItemChange object.
        SyncVersion moveVersion = GetMoveVersion(itemMeta, iFilter);

        // Only return a filter change if the destination knowledge does not contain the version of the 
        // last move that occurred in relation to the specified filter.
        FilterChange filterChange = null;
        if (!destKnowledge.Contains(ContactReplicaMetadata.ReplicaId, itemMeta.GlobalId, moveVersion))
        {
            filterChange = new FilterChange(GetIsInFilter(itemMeta, iFilter), moveVersion);
            itemChange.AddFilterChange((uint)filterKey, filterChange);
        }
    }
}

Jerarquía de herencia

System. . :: . .Object
  Microsoft.Synchronization..::..FilterChange

Seguridad para subprocesos

Todos los miembros públicos static (Shared en Visual Basic) de este tipo son seguros para subprocesos. No se garantiza que los miembros de instancia sean seguros para subprocesos.

Vea también

Referencia

FilterChange Miembros

Microsoft.Synchronization Espacio de nombres