/// <summary> /// Reports the progress on the changes being applied. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> static void applyingChanges(object sender, DbApplyingChangesEventArgs e) { string message; foreach (DbSyncTableProgress tableProgress in e.Context.ScopeProgress.TablesProgress) { if (tableProgress.TotalChanges == 0) { continue; } if (porcelain) { message = "t:" + tableProgress.TableName; message += "|i:" + tableProgress.Inserts.ToString() + "|u:" + tableProgress.Updates.ToString() + "|d:" + tableProgress.Deletes.ToString(); Console.WriteLine(message); } else { //message = "Applied changes for table: -> " + tableProgress.TableName; Console.Write("Applied changes for table: " + tableProgress.TableName); Console.ForegroundColor = ConsoleColor.Green; Console.Write(" ->"); Console.ResetColor(); message = " [ Inserts:" + tableProgress.Inserts.ToString() + " | Updates :" + tableProgress.Updates.ToString() + " | Deletes :" + tableProgress.Deletes.ToString() + " ]"; Console.Write(message + "\n"); } } }
/// <summary> /// On the client (remote) /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private static void Program_RemoteItemChanging(object sender, DbApplyingChangesEventArgs e) { // What is "remote item" in this case? var itemsAdded = e.Context.DataSet.GetChanges(DataRowState.Added); var itemsDeleted = e.Context.DataSet.GetChanges(DataRowState.Deleted); var itemsModified = e.Context.DataSet.GetChanges(DataRowState.Modified); }
protected void Proveedor_ApplyingChanges(object sender, DbApplyingChangesEventArgs e) { String mensaje = string.Format( "{0}:{1}\n\r{2}:{3}\n\r{4}:{5}\n\r{6}:{7}\n\r{8}:{9}\n\r", "\tSource Database :", e.Connection.Database, "\tContexto :", e.Context, "\tBatch count :", e.ScopeMetadata.BatchCount, "\tSession Id :", e.Session.SessionId, "\tTransaccion :", e.Transaction.ToString() ); Loguear("proveedor_ApplyingChanges", mensaje); }
protected abstract void SyncProviderOnApplyingChanges(object sender, DbApplyingChangesEventArgs dbApplyingChangesEventArgs);
protected void proveedor_ApplyingChanges(object sender, DbApplyingChangesEventArgs e) { String mensaje = string.Format( "{0}:{1}\n\r{2}:{3}\n\r{4}:{5}\n\r{6}:{7}\n\r{8}:{9}\n\r", "\tSource Database :", e.Connection.Database, "\tContexto :", e.Context, "\tBatch count :", e.ScopeMetadata.BatchCount, "\tSession Id :", e.Session.SessionId, "\tTransaccion :", e.Transaction.ToString() ); this.loguear( "proveedor_ApplyingChanges", mensaje); }
public void SynchronizeServer_ApplyingChanges(object sender, DbApplyingChangesEventArgs args) { LogChanges(args.Context.ScopeProgress.TablesProgress, "Server Applying Changes"); }
private static void Program_ApplyingChanges(object sender, DbApplyingChangesEventArgs e) { // display conflict type Console.WriteLine(e.Context.DataSet.DataSetName); }
private static void Provider_ApplyingChanges(object sender, DbApplyingChangesEventArgs e) { throw new NotImplementedException(); }
protected override void SyncProviderOnApplyingChanges(object sender, DbApplyingChangesEventArgs dbApplyingChangesEventArgs) { ShowMessage("Local"); }
/// <summary> /// Appplying changes on the client (taken from the server) /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private static void Program_ApplyingChanges(object sender, DbApplyingChangesEventArgs e) { var added = e.Changes.GetChanges(DataRowState.Added); var deleted = e.Changes.GetChanges(DataRowState.Deleted); var modified = e.Changes.GetChanges(DataRowState.Modified); }