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 命名空间