MemoryConflictLog.SaveConstraintConflict Method
Saves information about a change that caused a constraint conflict.
Namespace: Microsoft.Synchronization
Assembly: Microsoft.Synchronization (in Microsoft.Synchronization.dll)
Syntax
'Declaration
Public Sub SaveConstraintConflict ( _
conflictingChange As ItemChange, _
conflictingItemId As SyncId, _
reason As ConstraintConflictReason, _
conflictingChangeData As Object, _
conflictingChangeKnowledge As SyncKnowledge, _
temporary As Boolean _
)
'Usage
Dim instance As MemoryConflictLog
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)
public void SaveConstraintConflict(
ItemChange conflictingChange,
SyncId conflictingItemId,
ConstraintConflictReason reason,
Object conflictingChangeData,
SyncKnowledge conflictingChangeKnowledge,
bool temporary
)
public:
virtual void SaveConstraintConflict(
ItemChange^ conflictingChange,
SyncId^ conflictingItemId,
ConstraintConflictReason reason,
Object^ conflictingChangeData,
SyncKnowledge^ conflictingChangeKnowledge,
bool temporary
) sealed
abstract SaveConstraintConflict :
conflictingChange:ItemChange *
conflictingItemId:SyncId *
reason:ConstraintConflictReason *
conflictingChangeData:Object *
conflictingChangeKnowledge:SyncKnowledge *
temporary:bool -> unit
override SaveConstraintConflict :
conflictingChange:ItemChange *
conflictingItemId:SyncId *
reason:ConstraintConflictReason *
conflictingChangeData:Object *
conflictingChangeKnowledge:SyncKnowledge *
temporary:bool -> unit
public final function SaveConstraintConflict(
conflictingChange : ItemChange,
conflictingItemId : SyncId,
reason : ConstraintConflictReason,
conflictingChangeData : Object,
conflictingChangeKnowledge : SyncKnowledge,
temporary : boolean
)
Parameters
- conflictingChange
Type: Microsoft.Synchronization.ItemChange
The item metadata for the conflicting change from the source provider.
- conflictingItemId
Type: Microsoft.Synchronization.SyncId
The item ID of the item in the destination replica that conflicts with the item specified by conflictingChange.
- reason
Type: Microsoft.Synchronization.ConstraintConflictReason
The reason the conflict occurred.
- conflictingChangeData
Type: System.Object
The item data for the conflicting change.
- conflictingChangeKnowledge
Type: Microsoft.Synchronization.SyncKnowledge
The knowledge to be learned if this change is applied. This must be saved with the change.
- temporary
Type: System.Boolean
true if this is a temporary conflict. Otherwise, false.
Implements
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | conflictingChange or conflictingChangeKnowledge is a null reference (Nothing in Visual Basic). |
Remarks
The conflict is saved to the in-memory conflict log. To save the conflict after synchronization completes, call Persist.
Examples
The following example shows how to save a temporary constraint conflict by using a MemoryConflictLog object.
Public Sub SaveConstraintConflict(ByVal conflictingChange As ItemChange, ByVal conflictingItemId As SyncId, ByVal reason As ConstraintConflictReason, ByVal conflictingChangeData As Object, ByVal conflictingChangeKnowledge As SyncKnowledge, ByVal temporary As Boolean) Implements INotifyingChangeApplierTarget2.SaveConstraintConflict
If Not temporary Then
' 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)
End If
End Sub
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);
}
}