IFilterTrackingProvider::SpecifyTrackedFilters Method

When overridden in a derived class, specifies the filters that are tracked by the destination replica.

Namespace:  Microsoft.Synchronization
Assembly:  Microsoft.Synchronization (in Microsoft.Synchronization.dll)

void SpecifyTrackedFilters(
	RequestTrackedFilterCallback^ filterTrackingRequestCallback
)

Parameters

filterTrackingRequestCallback
Type: Microsoft.Synchronization::RequestTrackedFilterCallback
A delegate that can be called to specify the filters that are tracked by the destination replica.

Sync Framework calls SpecifyTrackedFilters on the destination provider, to determine which filters are tracked by the destination replica. The destination provider must call filterTrackingRequestCallback one time for each filter that is tracked by the destination replica. During processing of the filterTrackingRequestCallback handler, Sync Framework passes the specified filter to the TryAddTrackedFilter method of the source provider.

The following example enumerates the list of filters that are tracked by the destination replica and passes each one to the source provider. If the source provider also tracks the filter, the filter is added to the list of filters that are updated during synchronization.

Public Sub SpecifyTrackedFilters(ByVal filterTrackingRequestCallback As RequestTrackedFilterCallback) Implements IFilterTrackingProvider.SpecifyTrackedFilters
    For Each filter As AddressFilter In _ContactStore.TrackedFilters
        If filterTrackingRequestCallback(filter) Then
            _filterKeyMap.AddFilter(filter)
        End If
    Next
End Sub


public void SpecifyTrackedFilters(RequestTrackedFilterCallback filterTrackingRequestCallback)
{
    foreach (AddressFilter filter in _ContactStore.TrackedFilters)
    {
        if (filterTrackingRequestCallback(filter))
        {
            _filterKeyMap.AddFilter(filter);
        }
    }
}


Show: