共用方式為


INotifyingChangeApplierTarget2.SaveConstraintConflict 方法

在衍生類別中覆寫時,會儲存涉及條件約束衝突之項目的相關資訊。

命名空間: Microsoft.Synchronization
組件: Microsoft.Synchronization (在 microsoft.synchronization.dll)

語法

'宣告
Sub SaveConstraintConflict ( _
    conflictingChange As ItemChange, _
    conflictingItemId As SyncId, _
    reason As ConstraintConflictReason, _
    conflictingChangeData As Object, _
    conflictingChangeKnowledge As SyncKnowledge, _
    temporary As Boolean _
)
'用途
Dim instance As INotifyingChangeApplierTarget2
Dim conflictingChange As ItemChange
Dim conflictingItemId As SyncId
Dim reason As ConstraintConflictReason
Dim conflictingChangeData As Object
Dim conflictingChangeKnowledge As SyncKnowledge
Dim temporary As Boolean

instance.SaveConstraintConflict(conflictingChange, conflictingItemId, reason, conflictingChangeData, conflictingChangeKnowledge, temporary)
void SaveConstraintConflict (
    ItemChange conflictingChange,
    SyncId conflictingItemId,
    ConstraintConflictReason reason,
    Object conflictingChangeData,
    SyncKnowledge conflictingChangeKnowledge,
    bool temporary
)
void SaveConstraintConflict (
    ItemChange^ conflictingChange, 
    SyncId^ conflictingItemId, 
    ConstraintConflictReason reason, 
    Object^ conflictingChangeData, 
    SyncKnowledge^ conflictingChangeKnowledge, 
    bool temporary
)
void SaveConstraintConflict (
    ItemChange conflictingChange, 
    SyncId conflictingItemId, 
    ConstraintConflictReason reason, 
    Object conflictingChangeData, 
    SyncKnowledge conflictingChangeKnowledge, 
    boolean temporary
)
function SaveConstraintConflict (
    conflictingChange : ItemChange, 
    conflictingItemId : SyncId, 
    reason : ConstraintConflictReason, 
    conflictingChangeData : Object, 
    conflictingChangeKnowledge : SyncKnowledge, 
    temporary : boolean
)

參數

  • conflictingChange
    來源提供者中衝突變更的項目中繼資料。
  • conflictingItemId
    目的地複寫中與 conflictingChange 指定之項目發生衝突之項目的項目識別碼。
  • reason
    發生衝突的原因。
  • conflictingChangeData
    衝突變更的項目資料。
  • conflictingChangeKnowledge
    套用這個變更時要學習的知識。這項知識必須與變更一起儲存。
  • temporary
    如果這是暫時的衝突,則為 true,否則為 false

備註

如果這個衝突所代表的變更會套用至複寫,conflictingChangeKnowledge 就必須與該複寫的知識結合。

範例

下列範例將示範如何使用 MemoryConflictLog 物件來儲存暫時的條件約束衝突。

public void SaveConstraintConflict(ItemChange conflictingChange, SyncId conflictingItemId, 
    ConstraintConflictReason reason, object conflictingChangeData, SyncKnowledge conflictingChangeKnowledge, 
    bool temporary)
{
    if (!temporary)
    {
        // The in-memory conflict log is used, so if a non-temporary conflict is saved, it's
        // an error.
        throw new NotImplementedException("SaveConstraintConflict can only save temporary conflicts.");
    }
    else
    {
        // For temporary conflicts, just pass on the data and let the conflict log handle it.
        _memConflictLog.SaveConstraintConflict(conflictingChange, conflictingItemId, reason, 
            conflictingChangeData, conflictingChangeKnowledge, temporary);
    }
}

請參閱

參考

INotifyingChangeApplierTarget2 介面
INotifyingChangeApplierTarget2 成員
Microsoft.Synchronization 命名空間