SaveConstraintConflict Método
Guarda información sobre un cambio que produjo un conflicto de restricción.
Espacio de nombres: Microsoft.Synchronization
Ensamblado: Microsoft.Synchronization (en Microsoft.Synchronization.dll)
Sintaxis
'Declaración
Public Sub SaveConstraintConflict ( _
conflictingChange As ItemChange, _
conflictingItemId As SyncId, _
reason As ConstraintConflictReason, _
conflictingChangeData As Object, _
conflictingChangeKnowledge As SyncKnowledge, _
temporary As Boolean _
)
'Uso
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
)
Parámetros
- conflictingChange
Tipo: Microsoft.Synchronization. . :: . .ItemChange
Metadatos de elemento para el cambio en conflicto del proveedor de origen.
- conflictingItemId
Tipo: Microsoft.Synchronization. . :: . .SyncId
Identificador de elemento del elemento de la réplica de destino que está en conflicto con el elemento especificada por conflictingChange.
- reason
Tipo: Microsoft.Synchronization. . :: . .ConstraintConflictReason
Motivo por el que se produjo el conflicto.
- conflictingChangeData
Tipo: System. . :: . .Object
Datos de elemento para el cambio conflictivo.
- conflictingChangeKnowledge
Tipo: Microsoft.Synchronization. . :: . .SyncKnowledge
Conocimiento que se va a obtener si se aplica este cambio. Este conocimiento se debe guardar con el cambio.
- temporary
Tipo: System. . :: . .Boolean
true si se trata de un conflicto temporal. En caso contrario, false.
Implementa
Excepciones
Excepción | Condición |
---|---|
ArgumentNullException | conflictingChange o conflictingChangeKnowledge es un valor null Nothing nullptr unit es una referencia NULL (Nothing en Visual Basic). . |
Notas
El conflicto se guarda en el registro de conflictos en memoria. Para guardar el conflicto una vez que se completa la sincronización, llame al método Persist.
Ejemplos
En el ejemplo siguiente se muestra cómo guardar un conflicto de restricción temporal utilizando un objeto MemoryConflictLog.
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);
}
}