private void SyncCompletedCallback(IAsyncResult ar) { try { SqlCeReplication repl = (SqlCeReplication)ar.AsyncState; repl.EndSynchronize(ar); repl.SaveProperties(); string result = "Successfully completed sync" + Environment.NewLine; result += string.Format("Number of changes downloaded: {0}{1}", repl.PublisherChanges.ToString(), Environment.NewLine); result += string.Format("Number of changes uploaded: {0}{1}", repl.SubscriberChanges.ToString(), Environment.NewLine); result += string.Format("Number of conflicts at Publisher: {0}{1}", repl.PublisherConflicts.ToString(), Environment.NewLine); #if V40 SyncArgs4 args = new SyncArgs4(result, null); #else SyncArgs args = new SyncArgs(result, null); #endif Completed(this, args); } catch (SqlCeException e) { #if V40 SyncArgs4 args = new SyncArgs4("Errors occured during sync", e); #else SyncArgs args = new SyncArgs("Errors occured during sync", e); #endif Completed(this, args); } }
private void OnStartTableDownloadCallback(IAsyncResult ar, string tableName) { this.tableName = tableName; #if V40 var args = new SyncArgs4("Began downloading table : " + tableName, null); #else var args = new SyncArgs("Began downloading table : " + tableName, null); #endif Progress(this, args); }
private void OnSynchronizationCallback(IAsyncResult ar, int percentComplete) { this.percentage = percentComplete; #if V40 var args = new SyncArgs4("Sync with SQL Server is " + percentage.ToString() + "% complete.", null); #else var args = new SyncArgs("Sync with SQL Server is " + percentage.ToString() + "% complete.", null); #endif Progress(this, args); }