public void ProgressChanged(SyncStagedProgressEventArgs args) { string message = ""; listSyncProgress.Items.Add(message); try { DbSyncSessionProgressEventArgs sessionProgress = (DbSyncSessionProgressEventArgs)args; DbSyncScopeProgress progress = sessionProgress.GroupProgress; switch (sessionProgress.DbSyncStage) { case DbSyncStage.SelectingChanges: message += "Sync Stage: Selecting Changes"; listSyncProgress.Items.Add(message); foreach (DbSyncTableProgress tableProgress in progress.TablesProgress) { message = "Enumerated changes for table: " + tableProgress.TableName; message += "[Inserts:" + tableProgress.Inserts.ToString() + "/Updates :" + tableProgress.Updates.ToString() + "/Deletes :" + tableProgress.Deletes.ToString() + "]"; listSyncProgress.Items.Add(message); } break; case DbSyncStage.ApplyingChanges: message += "Sync Stage: Applying Changes"; listSyncProgress.Items.Add(message); foreach (DbSyncTableProgress tableProgress in progress.TablesProgress) { message = "Applied changes for table: " + tableProgress.TableName; message += "[Inserts:" + tableProgress.Inserts.ToString() + "/Updates :" + tableProgress.Updates.ToString() + "/Deletes :" + tableProgress.Deletes.ToString() + "]"; listSyncProgress.Items.Add(message); } break; default: break; } message = "Total Changes : " + progress.TotalChanges.ToString() + " Inserts :" + progress.TotalInserts.ToString(); message += " Updates :" + progress.TotalUpdates.ToString() + " Deletes :" + progress.TotalDeletes.ToString(); listSyncProgress.Items.Add(message); } catch (Exception e) { throw e; } message = "Completed : " + args.CompletedWork + "%"; listSyncProgress.Items.Add(message); Application.DoEvents(); }
public void ChangesApplied(DbChangesAppliedEventArgs args) { DbSyncScopeProgress progress = args.Context.ScopeProgress; string message = ""; listSyncProgress.Items.Add(message); foreach (DbSyncTableProgress tableProgress in args.Context.ScopeProgress.TablesProgress) { message = "Applied changes for table: " + tableProgress.TableName; message += "[Applied:" + tableProgress.ChangesApplied.ToString() + "/Failed:" + tableProgress.ChangesFailed.ToString() + "/Pending:" + tableProgress.ChangesPending.ToString() + "/Total:" + tableProgress.TotalChanges.ToString() + "]"; listSyncProgress.Items.Add(message); } message = "Total Changes Applied: " + progress.TotalChanges.ToString() + " Inserts :" + progress.TotalInserts.ToString(); message += " Updates :" + progress.TotalUpdates.ToString() + " Deletes :" + progress.TotalDeletes.ToString(); listSyncProgress.Items.Add(message); Application.DoEvents(); }
public void ChangesSelected(DbChangesSelectedEventArgs args) { DbSyncScopeProgress progress = args.Context.ScopeProgress; string message = ""; listSyncProgress.Items.Add(message); foreach (DbSyncTableProgress tableProgress in args.Context.ScopeProgress.TablesProgress) { message = "Enumerated changes for table: " + tableProgress.TableName; message += "[Inserts:" + tableProgress.Inserts.ToString() + "/Updates :" + tableProgress.Updates.ToString() + "/Deletes :" + tableProgress.Deletes.ToString() + "]"; listSyncProgress.Items.Add(message); } message = "Total Changes Enumerated: " + progress.TotalChanges.ToString() + " Inserts :" + progress.TotalInserts.ToString(); message += " Updates :" + progress.TotalUpdates.ToString() + " Deletes :" + progress.TotalDeletes.ToString(); listSyncProgress.Items.Add(message); Application.DoEvents(); }