Udostępnij za pośrednictwem


IFilterTrackingProvider.TryAddTrackedFilter Method

When overridden in a derived class, informs the source provider which filters are tracked by the destination replica.

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

Syntax

'Declaration
Function TryAddTrackedFilter ( _
    filter As ISyncFilter _
) As Boolean
'Usage
Dim instance As IFilterTrackingProvider
Dim filter As ISyncFilter
Dim returnValue As Boolean

returnValue = instance.TryAddTrackedFilter(filter)
bool TryAddTrackedFilter (
    ISyncFilter filter
)
bool TryAddTrackedFilter (
    ISyncFilter^ filter
)
boolean TryAddTrackedFilter (
    ISyncFilter filter
)
function TryAddTrackedFilter (
    filter : ISyncFilter
) : boolean

Parameters

  • filter
    A filter that is tracked by the destination replica.

Return Value

true when the source provider tracks the filter specified by filter. Otherwise, false.

Remarks

Sync Framework calls TryAddTrackedFilter on the source provider one time for each filter that is tracked by the destination replica.

Example

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;
}

See Also

Reference

IFilterTrackingProvider Interface
IFilterTrackingProvider Members
Microsoft.Synchronization Namespace