コード例 #1
0
        /// <summary>
        /// Start synchronizing with device.
        /// </summary>
        /// <param name="device">Which device it is going to synchronize.</param>
        public void SynchronizeWith(SynchronizationDevice device)
        {
            clearAndResetDatas();
            receiver = new ChangeReceiver(device, this, resultChanges);

            SendConnectRequest(device.IP);

            localChangeFinder.Reset(device.LastSynchDate, resultChanges);

            localChangeFinderThread = new Thread(localChangeFinder.DoWork);
            localChangeFinderThread.IsBackground = true;
            localChangeFinderThread.Name         = " - Local change Adder Thread";
            localChangeFinderThread.Start(LocalListBoxData);

            DialogResult res;

            using (SynchForm form = new SynchForm(device, this))
            {
                res = form.ShowDialog();
            }

            if (res == DialogResult.OK)
            {
                device.LastSynchDate = DateTime.Now.AddSeconds(5);
                db.UpdateSynchronizationDevice(device);
            }
        }
コード例 #2
0
        /// <summary>
        /// Start synchronizing with device.
        /// </summary>
        /// <param name="device">Which device it is going to synchronize.</param>
        public void SynchronizeWith(SynchronizationDevice device)
        {
            clearAndResetDatas();
            receiver = new ChangeReceiver(device, this, resultChanges);

            SendConnectRequest(device.IP);

            localChangeFinder.Reset(device.LastSynchDate, resultChanges);

            localChangeFinderThread = new Thread(localChangeFinder.DoWork);
            localChangeFinderThread.IsBackground = true;
            localChangeFinderThread.Name = " - Local change Adder Thread";
            localChangeFinderThread.Start(LocalListBoxData);

            DialogResult res;
            using (SynchForm form = new SynchForm(device, this))
            {
                res = form.ShowDialog();
            }

            if (res == DialogResult.OK)
            {
                device.LastSynchDate = DateTime.Now.AddSeconds(5);
                db.UpdateSynchronizationDevice(device);
            }
        }