IFilterTrackingProvider::TryAddTrackedFilter Method
When overridden in a derived class, informs the source provider which filters are tracked by the destination replica.
Assembly: Microsoft.Synchronization (in Microsoft.Synchronization.dll)
Parameters
- filter
- Type: Microsoft.Synchronization::ISyncFilter
A filter that is tracked by the destination replica.
Return Value
Type: System::Booleantrue when the source provider tracks the filter specified by filter. Otherwise, false.
The following example checks whether the specified filter is tracked by the source replica. If it is tracked, the filter is added to the list of filters that are updated during synchronization.
Public Function TryAddTrackedFilter(ByVal filter As ISyncFilter) As Boolean Implements IFilterTrackingProvider.TryAddTrackedFilter Dim isTracked As Boolean = False For Each addressFilter As AddressFilter In _ContactStore.TrackedFilters If addressFilter.IsIdentical(filter) Then _filterKeyMap.AddFilter(addressFilter) isTracked = True Exit For End If Next Return isTracked End Function
public bool TryAddTrackedFilter(ISyncFilter filter) { bool isTracked = false; foreach (AddressFilter addressFilter in _ContactStore.TrackedFilters) { if (addressFilter.IsIdentical(filter)) { _filterKeyMap.AddFilter(addressFilter); isTracked = true; break; } } return isTracked; }
Show: