ResolveAction 列挙体

同期中にクライアントで発生する競合を解決するオプションを指定します。

名前空間: Microsoft.Synchronization.Data
アセンブリ: Microsoft.Synchronization.Data (microsoft.synchronization.data.dll 内)

構文

'宣言
Public Enumeration ResolveAction
'使用
Dim instance As ResolveAction
public enum ResolveAction
public enum class ResolveAction
public enum ResolveAction
public enum ResolveAction

メンバー

  メンバー名 説明
ClientWins サーバーの行をクライアントの行で上書きします。 
FireEvent クライアントの ApplyChangeFailed イベントまたはサーバーの ApplyChangeFailed イベントを発生させます。 
ServerWins クライアントの行をサーバーの行で上書きします。 

解説

SqlCeClientSyncProvider には、クライアントでの競合の解決に使用できる ConflictResolver プロパティが含まれています。競合の種類ごとに、ResolveAction 列挙体から値を設定できます。

競合の種類ごとに ConflictResolver を設定する必要はありません。ApplyChangeFailed イベントを処理することによって、サーバーの場合と同様に競合を解決できます。ただし、ConflictResolver プロパティを使用すると、クライアントで競合解決オプションを簡単に指定できます。詳細については、「データの競合とエラーを処理する方法」を参照してください。

次のコード例は、クライアント同期プロバイダーで発生する可能性のある競合の種類ごとに解決アクションを設定します。完全なコンテキスト例でこのコードを表示するには、「データの競合とエラーを処理する方法」を参照してください。

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

参照

リファレンス

Microsoft.Synchronization.Data 名前空間