Поделиться через


Конструктор SyncConflictResolver

Инициализирует новый экземпляр класса SyncConflictResolver.

Пространство имен: Microsoft.Synchronization.Data
Сборка: Microsoft.Synchronization.Data (в microsoft.synchronization.data.dll)

Синтаксис

'Декларация
Public Sub New
'Применение
Dim instance As New SyncConflictResolver
public SyncConflictResolver ()
public:
SyncConflictResolver ()
public SyncConflictResolver ()
public function SyncConflictResolver ()

Пример

В следующем примере кода задается действие по разрешению каждого из типов конфликтов, которые могут возникнуть в службе синхронизации на клиенте. Чтобы просмотреть этот код в контексте полного примера, см. раздел Как обрабатывать конфликты и ошибки в данных.

this.ConflictResolver.ClientDeleteServerUpdateAction = ResolveAction.ServerWins;            
this.ConflictResolver.ClientUpdateServerDeleteAction = ResolveAction.ClientWins;
//If any of the following conflicts or errors occur, the ApplyChangeFailed
//event is raised.
this.ConflictResolver.ClientInsertServerInsertAction = ResolveAction.FireEvent;
this.ConflictResolver.ClientUpdateServerUpdateAction = ResolveAction.FireEvent;
this.ConflictResolver.StoreErrorAction = ResolveAction.FireEvent;

//Log information for the ApplyChangeFailed event and handle any
//ResolveAction.FireEvent cases.
this.ApplyChangeFailed +=new EventHandler<ApplyChangeFailedEventArgs>(SampleClientSyncProvider_ApplyChangeFailed);
Me.ConflictResolver.ClientDeleteServerUpdateAction = ResolveAction.ServerWins
Me.ConflictResolver.ClientUpdateServerDeleteAction = ResolveAction.ClientWins
'If any of the following conflicts or errors occur, the ApplyChangeFailed
'event is raised.
Me.ConflictResolver.ClientInsertServerInsertAction = ResolveAction.FireEvent
Me.ConflictResolver.ClientUpdateServerUpdateAction = ResolveAction.FireEvent
Me.ConflictResolver.StoreErrorAction = ResolveAction.FireEvent

'Log information for the ApplyChangeFailed event and handle any
'ResolveAction.FireEvent cases.
AddHandler Me.ApplyChangeFailed, AddressOf SampleClientSyncProvider_ApplyChangeFailed

См. также

Справочник

Класс SyncConflictResolver
Элементы SyncConflictResolver
Пространство имен Microsoft.Synchronization.Data