Partilhar via


Método INotifyingChangeApplierTarget2.SaveConstraintConflict

Quando substituído em uma classe derivada, salva informações sobre itens que estão envolvidos em um conflito de restrição.

Namespace: Microsoft.Synchronization
Assembly: Microsoft.Synchronization (em microsoft.synchronization.dll)

Sintaxe

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

Parâmetros

  • conflictingChange
    Os metadados de item para a alteração conflitante do provedor de origem.
  • conflictingItemId
    A ID do item na réplica de destino que está em conflito com o item especificado por conflictingChange.
  • reason
    O motivo pelo qual o conflito ocorreu.
  • conflictingChangeData
    Os dados de item para a alteração conflitante.
  • conflictingChangeKnowledge
    O conhecimento a ser adquirido se essa alteração for aplicada. Esse conhecimento deve ser salvo com a alteração.
  • temporary
    true se esse for um conflito temporário. Caso contrário, false.

Comentários

Se a alteração representada por esse conflito for aplicada a uma réplica, conflictingChangeKnowledge deverá ser combinado com o conhecimento dessa réplica.

Exemplo

O exemplo a seguir mostra como salvar um conflito de restrição temporário usando um objeto 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);
    }
}

Consulte também

Referência

Interface INotifyingChangeApplierTarget2
Membros INotifyingChangeApplierTarget2
Namespace Microsoft.Synchronization