IFilterTrackingNotifyingChangeApplierTarget.SaveKnowledgeWithFilterForgottenKnowledge 方法

在派生类中重写时,保存知识、遗忘知识和筛选器遗忘知识对象的列表。

命名空间: Microsoft.Synchronization
程序集: Microsoft.Synchronization(在 microsoft.synchronization.dll 中)

语法

声明
Sub SaveKnowledgeWithFilterForgottenKnowledge ( _
    syncKnowledge As SyncKnowledge, _
    forgottenKnowledge As ForgottenKnowledge, _
    filterForgottenKnowledge As ForgottenKnowledge() _
)
用法
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
)
void SaveKnowledgeWithFilterForgottenKnowledge (
    SyncKnowledge syncKnowledge, 
    ForgottenKnowledge forgottenKnowledge, 
    ForgottenKnowledge[] filterForgottenKnowledge
)
function SaveKnowledgeWithFilterForgottenKnowledge (
    syncKnowledge : SyncKnowledge, 
    forgottenKnowledge : ForgottenKnowledge, 
    filterForgottenKnowledge : ForgottenKnowledge[]
)

参数

  • syncKnowledge
    要保存的更新知识。
  • forgottenKnowledge
    要保存的遗忘知识。如果此参数为 null 引用(在 Visual Basic 中为 Nothing),则现有遗忘知识将保持不变并且不应被替换。
  • filterForgottenKnowledge
    要保存的筛选器遗忘知识对象的列表。此列表按照筛选键映射中的筛选键进行排序。

备注

syncKnowledge 必须替换作用域的现有知识。如果 forgottenKnowledge 不为 null 引用(在 Visual Basic 中为 Nothing),则 forgottenKnowledge 还必须替换作用域的遗忘知识;否则必须保留现有遗忘知识。filterForgottenKnowledge 中包含的筛选器遗忘知识对象也必须替换副本的相应筛选器遗忘知识对象。Sync Framework 会在处理完变更批中的所有变更后对每个变更批调用一次此方法。

示例

下面的示例将筛选器遗忘知识对象的列表保存到副本,然后调用 StoreKnowledgeForScope 来保存更新的知识和遗忘知识。

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

请参阅

参考

IFilterTrackingNotifyingChangeApplierTarget 接口
IFilterTrackingNotifyingChangeApplierTarget 成员
Microsoft.Synchronization 命名空间