共用方式為


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 命名空間