Exemplo n.º 1
0
        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);
            }
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
        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);

        }
Exemplo n.º 6
0
        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);
            }
        }