次の方法で共有


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
)
abstract SaveConstraintConflict : 
        conflictingChange:ItemChange * 
        conflictingItemId:SyncId * 
        reason:ConstraintConflictReason * 
        conflictingChangeData:Object * 
        conflictingChangeKnowledge:SyncKnowledge * 
        temporary:bool -> unit 
function SaveConstraintConflict(
    conflictingChange : ItemChange, 
    conflictingItemId : SyncId, 
    reason : ConstraintConflictReason, 
    conflictingChangeData : Object, 
    conflictingChangeKnowledge : SyncKnowledge, 
    temporary : boolean
)

パラメーター

説明

この競合が表す変更がレプリカに適用された場合、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 名前空間