Share via


IFilterTrackingNotifyingChangeApplierTarget.SaveKnowledgeWithFilterForgottenKnowledge Method

When overridden in a derived class, saves knowledge, forgotten knowledge, and a list of filter forgotten knowledge objects.

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

Syntax

'Declaration
Sub SaveKnowledgeWithFilterForgottenKnowledge ( _
    syncKnowledge As SyncKnowledge, _
    forgottenKnowledge As ForgottenKnowledge, _
    filterForgottenKnowledge As ForgottenKnowledge() _
)
'Usage
Dim instance As IFilterTrackingNotifyingChangeApplierTarget
Dim syncKnowledge As SyncKnowledge
Dim forgottenKnowledge As ForgottenKnowledge
Dim filterForgottenKnowledge As ForgottenKnowledge()

instance.SaveKnowledgeWithFilterForgottenKnowledge(syncKnowledge, _
    forgottenKnowledge, filterForgottenKnowledge)
void SaveKnowledgeWithFilterForgottenKnowledge(
    SyncKnowledge syncKnowledge,
    ForgottenKnowledge forgottenKnowledge,
    ForgottenKnowledge[] filterForgottenKnowledge
)
void SaveKnowledgeWithFilterForgottenKnowledge(
    SyncKnowledge^ syncKnowledge, 
    ForgottenKnowledge^ forgottenKnowledge, 
    array<ForgottenKnowledge^>^ filterForgottenKnowledge
)
abstract SaveKnowledgeWithFilterForgottenKnowledge : 
        syncKnowledge:SyncKnowledge * 
        forgottenKnowledge:ForgottenKnowledge * 
        filterForgottenKnowledge:ForgottenKnowledge[] -> unit 
function SaveKnowledgeWithFilterForgottenKnowledge(
    syncKnowledge : SyncKnowledge, 
    forgottenKnowledge : ForgottenKnowledge, 
    filterForgottenKnowledge : ForgottenKnowledge[]
)

Parameters

  • forgottenKnowledge
    Type: Microsoft.Synchronization.ForgottenKnowledge
    The forgotten knowledge to be saved. If this parameter is a null reference (Nothing in Visual Basic), existing forgotten knowledge remains unchanged and should not be replaced.

Remarks

syncKnowledge must replace the existing knowledge for the scope. If forgottenKnowledge is not a null reference (Nothing in Visual Basic), forgottenKnowledge must also replace the forgotten knowledge for the scope; otherwise, the existing forgotten knowledge must be kept. The filter forgotten knowledge objects that are contained in filterForgottenKnowledge must also replace the corresponding filter forgotten knowledge objects of the replica. Sync Framework calls this method one time per change batch after all changes in the change batch have been processed.

Examples

The following example saves the list of filter forgotten knowledge objects to the replica and then calls StoreKnowledgeForScope to save the updated knowledge and forgotten knowledge.

Public Sub SaveKnowledgeWithFilterForgottenKnowledge(ByVal syncKnowledge As SyncKnowledge, ByVal forgottenKnowledge As ForgottenKnowledge, ByVal filterForgottenKnowledge As ForgottenKnowledge()) Implements IFilterTrackingNotifyingChangeApplierTarget.SaveKnowledgeWithFilterForgottenKnowledge
    ' First update the list of filter forgotten knowledge objects.
    For iFilter As Integer = 0 To filterForgottenKnowledge.Length - 1
        DirectCast(_filterKeyMap(iFilter), AddressFilter).FilterForgottenKnowledge = filterForgottenKnowledge(iFilter)
    Next

    ' Update the list of filters that are stored in the custom replica metadata.
    AddressFilter.StoreFiltersInReplicaMetadata(_ContactStore.ContactReplicaMetadata, _ContactStore.TrackedFilters)

    ' Store the remaining knowledge objects.
    StoreKnowledgeForScope(syncKnowledge, forgottenKnowledge)
End Sub
public void SaveKnowledgeWithFilterForgottenKnowledge(SyncKnowledge syncKnowledge, ForgottenKnowledge forgottenKnowledge, ForgottenKnowledge[] filterForgottenKnowledge)
{
    // First update the list of filter forgotten knowledge objects.
    for (int iFilter = 0; iFilter < filterForgottenKnowledge.Length; iFilter++)
    {
        ((AddressFilter)_filterKeyMap[iFilter]).FilterForgottenKnowledge = filterForgottenKnowledge[iFilter];
    }

    // Update the list of filters that are stored in the custom replica metadata.
    AddressFilter.StoreFiltersInReplicaMetadata(_ContactStore.ContactReplicaMetadata, _ContactStore.TrackedFilters);

    // Store the remaining knowledge objects.
    StoreKnowledgeForScope(syncKnowledge, forgottenKnowledge);
}

See Also

Reference

IFilterTrackingNotifyingChangeApplierTarget Interface

Microsoft.Synchronization Namespace