INotifyingChangeApplierTarget2.SaveConstraintConflict Method

When overridden in a derived class, saves information about items that are involved in a constraint conflict.

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

Syntax

'Declaration
Sub SaveConstraintConflict ( _
    conflictingChange As ItemChange, _
    conflictingItemId As SyncId, _
    reason As ConstraintConflictReason, _
    conflictingChangeData As Object, _
    conflictingChangeKnowledge As SyncKnowledge, _
    temporary As Boolean _
)
'Usage
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
)

Parameters

  • conflictingItemId
    Type: Microsoft.Synchronization.SyncId
    The item ID of the item in the destination replica that conflicts with the item specified by conflictingChange.
  • conflictingChangeData
    Type: System.Object
    The item data for the conflicting change.
  • temporary
    Type: System.Boolean
    true if this is a temporary conflict. Otherwise, false.

Remarks

If the change that is represented by this conflict is applied to a replica, conflictingChangeKnowledge must be combined with the knowledge of that replica.

Examples

The following example shows how to save a temporary constraint conflict by using a MemoryConflictLog object.

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

See Also

Reference

INotifyingChangeApplierTarget2 Interface

Microsoft.Synchronization Namespace