Example #1
0
        private void  步所有数据ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                Synchronize syncSub = new Synchronize();

                // Disable the current form
                this.Enabled = false;

                syncSub.Show(this);

                syncSub.SynchronizeSubscriptionFull();
            }
            catch (Exception ex)
            {
                ExceptionMessageBox emb = new ExceptionMessageBox(ex,
                                                                  ExceptionMessageBoxButtons.OK);
                emb.Show(this);
            }
            finally
            {
                // Enable the current form
                loadLastAgentSessionSummary();
                this.Enabled = true;
            }
        }
Example #2
0
        private void syncTimer_Elapsed(object sender, ElapsedEventArgs e)
        {
            Synchronize syncSub;

            // Start a background synchronization if an Internet connection is
            // available and data is not being edited.
            if (GetConnectionState() == ConnectedState.Connected)
            {
                syncWhenConnectedIcon.Image = Properties.Resources.connected;

                // Instantiate the replication code without the Form.
                syncSub = new Synchronize();


                syncWhenConnectedText.Text
                    = Properties.Resources.StatusSyncStarting;

                syncWhenConnectedIcon.Image = Properties.Resources.synchronizing;

                try
                {
                    syncSub.Status += new SyncWhenConnectedStatus(syncSub_Status);
                    syncSub.SynchronizeSubscriptionFull();


                    syncWhenConnectedText.Text
                        = Properties.Resources.StatusSyncComplete;
                }
                catch
                {
                    syncWhenConnectedText.Text
                        = Properties.Resources.StatusSyncFailed;
                }
                finally
                {
                    syncWhenConnectedIcon.Image = Properties.Resources.connected;
                    loadLastAgentSessionSummary();
                    // Reload data from database
                }
            }
            else
            {
                syncWhenConnectedIcon.Image = Properties.Resources.disconnected;
                notifyIcon.Text             = "网络连接断开";
            }
        }
Example #3
0
        private void 同步所有数据ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                Synchronize syncSub = new Synchronize();

                // Disable the current form
                this.Enabled = false;

                syncSub.Show(this);

                syncSub.SynchronizeSubscriptionFull();
            }
            catch (Exception ex)
            {
                ExceptionMessageBox emb = new ExceptionMessageBox(ex,
                    ExceptionMessageBoxButtons.OK);
                emb.Show(this);
            }
            finally
            {
                // Enable the current form
                loadLastAgentSessionSummary();
                this.Enabled = true;
            }
        }
Example #4
0
        private void syncTimer_Elapsed(object sender, ElapsedEventArgs e)
        {
            Synchronize syncSub;

            // Start a background synchronization if an Internet connection is
            // available and data is not being edited.
            if (GetConnectionState() == ConnectedState.Connected)
            {
                syncWhenConnectedIcon.Image = Properties.Resources.connected;

                // Instantiate the replication code without the Form.
                syncSub = new Synchronize();

                syncWhenConnectedText.Text
                   = Properties.Resources.StatusSyncStarting;

                syncWhenConnectedIcon.Image = Properties.Resources.synchronizing;

                try
                {
                    syncSub.Status += new SyncWhenConnectedStatus(syncSub_Status);
                    syncSub.SynchronizeSubscriptionFull();

                    syncWhenConnectedText.Text
                        = Properties.Resources.StatusSyncComplete;
                }
                catch
                {
                    syncWhenConnectedText.Text
                        = Properties.Resources.StatusSyncFailed;
                }
                finally
                {
                    syncWhenConnectedIcon.Image = Properties.Resources.connected;
                    loadLastAgentSessionSummary();
                    // Reload data from database
                }
            }
            else
            {
                syncWhenConnectedIcon.Image = Properties.Resources.disconnected;
                notifyIcon.Text = "网络连接断开";
            }
        }