// -------------------------------------------------------------------------------------------------------------------------------------------------------

        internal void Sync(SyncControlGridItemSet sync_control_grid_item_set)
        {
            Logging.Info("Syncing");

            foreach (SyncControlGridItem sync_control_grid_item_temp in sync_control_grid_item_set.grid_items)
            {
                // Needed for passing to background thread...
                SyncControlGridItem sync_control_grid_item = sync_control_grid_item_temp;

                if (sync_control_grid_item.library_sync_detail.web_library_detail.library.sync_in_progress)
                {
                    if (!sync_control_grid_item_set.sync_request.suppress_already_in_progress_notification)
                    {
                        MessageBoxes.Info("A sync operation is already in progress for library {0}.  Please wait for it to finish before trying to sync again.", sync_control_grid_item.library_sync_detail.web_library_detail.library.WebLibraryDetail.Title);
                    }
                    else
                    {
                        Logging.Info("A sync operation is already in progress for library {0}.  This has been suppressed from the GUI.", sync_control_grid_item.library_sync_detail.web_library_detail.library.WebLibraryDetail.Title);
                    }
                }
                else
                {
                    if (sync_control_grid_item.SyncMetadata || sync_control_grid_item.SyncDocuments)
                    {
                        sync_control_grid_item.library_sync_detail.web_library_detail.library.sync_in_progress = true;
                        SafeThreadPool.QueueUserWorkItem(o => Sync_BACKGROUND(sync_control_grid_item));
                    }
                }
            }
        }
        internal void RefreshSyncControl(SyncControlGridItemSet scgis_previous, SyncControl sync_control)
        {
            WPFDoEvents.SetHourglassCursor();

            SafeThreadPool.QueueUserWorkItem(o =>
            {
                //
                // Explicitly instruct the sync info collector to perform a swift scan, which DOES NOT include
                // collecting the precise size of every document in every Qiqqa library (which itself is a *significant*
                // file system load when you have any reasonably large libraries like I do.          [GHo]
                //
                // TODO: fetch and cache document filesizes in the background, so we can improve on the accuracy of
                // our numbers in a future call to this method.
                //
                GlobalSyncDetail global_sync_detail = GenerateGlobalSyncDetail(tally_library_storage_size: false);
                WPFDoEvents.InvokeInUIThread(() =>
                {
                    WPFDoEvents.ResetHourglassCursor();

                    SyncControlGridItemSet scgis = new SyncControlGridItemSet(scgis_previous.sync_request, global_sync_detail);
                    scgis.AutoTick();
                    sync_control.SetSyncParameters(scgis);
                });
            });
        }
        public void RequestSync(SyncRequest sync_request)
        {
            bool user_wants_intervention = KeyboardTools.IsCTRLDown() || !ConfigurationManager.Instance.ConfigurationRecord.SyncTermsAccepted;

            WPFDoEvents.SetHourglassCursor();

            SafeThreadPool.QueueUserWorkItem(o =>
            {
                GlobalSyncDetail global_sync_detail = GenerateGlobalSyncDetail();
                WPFDoEvents.InvokeInUIThread(() =>
                {
                    WPFDoEvents.ResetHourglassCursor();

                    SyncControlGridItemSet scgis = new SyncControlGridItemSet(sync_request, global_sync_detail);
                    scgis.AutoTick();

                    if (scgis.CanRunWithoutIntervention() && !user_wants_intervention)
                    {
                        Sync(scgis);
                    }
                    else
                    {
                        SyncControl sync_control = new SyncControl();
                        sync_control.SetSyncParameters(scgis);
                        sync_control.Show();
                    }
                });
            });
        }
        internal void RefreshSyncControl(SyncControlGridItemSet scgis_previous, SyncControl sync_control)
        {
            GlobalSyncDetail       global_sync_detail = GenerateGlobalSyncDetail();
            SyncControlGridItemSet scgis = new SyncControlGridItemSet(scgis_previous.sync_request, global_sync_detail);

            scgis.AutoTick();
            sync_control.SetSyncParameters(scgis);
        }
        internal void RefreshSyncControl(SyncControlGridItemSet scgis_previous, SyncControl sync_control)
        {
            WPFDoEvents.SetHourglassCursor();

            SafeThreadPool.QueueUserWorkItem(o =>
            {
                GlobalSyncDetail global_sync_detail = GenerateGlobalSyncDetail();
                WPFDoEvents.InvokeInUIThread(() =>
                {
                    WPFDoEvents.ResetHourglassCursor();

                    SyncControlGridItemSet scgis = new SyncControlGridItemSet(scgis_previous.sync_request, global_sync_detail);
                    scgis.AutoTick();
                    sync_control.SetSyncParameters(scgis);
                });
            });
        }
示例#6
0
        // -------------------------------------------------------------------------------------------------------------------------------------------------------

        internal void Sync(SyncControlGridItemSet sync_control_grid_item_set)
        {
            Logging.Info("Syncing");

            foreach (SyncControlGridItem sync_control_grid_item_temp in sync_control_grid_item_set.grid_items)
            {
                // Needed for passing to background thread...
                SyncControlGridItem sync_control_grid_item = sync_control_grid_item_temp;
                WebLibraryDetail    web_library_detail     = sync_control_grid_item.library_sync_detail.web_library_detail;

                if (!web_library_detail.IsIntranetLibrary)
                {
                    string local_sync_db = HistoricalSyncFile.GetSyncDbFilename(web_library_detail);

                    if (File.Exists(local_sync_db))
                    {
                        Logging.Warn("INTEGRITY CHECK 'CURIOSITY': library '{0}' has a Historical Sync file at '{1}', while at the same time seems to NOT HAVE a Sync Point a.k.a. Share Target set and thus cannot be synced. The presense of the Histrorical Sync File indicates that this library has had a Sync Point sometime in the past.", web_library_detail, local_sync_db);
                    }

                    Logging.Warn("SYNC IGNORE: library '{0}' has no Sync Point a.k.a. Share Target set and thus cannot be synced.", web_library_detail);
                }

                if (web_library_detail.Xlibrary.sync_in_progress)
                {
                    if (!sync_control_grid_item_set.sync_request.suppress_already_in_progress_notification)
                    {
                        MessageBoxes.Info("A sync operation is already in progress for library {0}.  Please wait for it to finish before trying to sync again.", web_library_detail.Title);
                    }
                    else
                    {
                        Logging.Info("A sync operation is already in progress for library {0}.  This has been suppressed from the GUI.", web_library_detail.Title);
                    }
                }
                else
                {
                    if (sync_control_grid_item.SyncLibrary)
                    {
                        web_library_detail.Xlibrary.sync_in_progress = true;
                        SafeThreadPool.QueueUserWorkItem(o => Sync_BACKGROUND(sync_control_grid_item));
                    }
                }
            }
        }
        public void RequestSync(SyncRequest sync_request)
        {
            bool user_wants_intervention = KeyboardTools.IsCTRLDown() || !ConfigurationManager.Instance.ConfigurationRecord.SyncTermsAccepted;

            GlobalSyncDetail       global_sync_detail = GenerateGlobalSyncDetail();
            SyncControlGridItemSet scgis = new SyncControlGridItemSet(sync_request, global_sync_detail);

            scgis.AutoTick();

            if (scgis.CanRunWithoutIntervention() && !user_wants_intervention)
            {
                Sync(scgis);
            }
            else
            {
                SyncControl sync_control = new SyncControl();
                sync_control.SetSyncParameters(scgis);
                sync_control.Show();
            }
        }
示例#8
0
        public void RequestSync(SyncRequest sync_request)
        {
            WPFDoEvents.AssertThisCodeIsRunningInTheUIThread();

            bool user_wants_intervention = KeyboardTools.IsCTRLDown() || !ConfigurationManager.Instance.ConfigurationRecord.SyncTermsAccepted;

            WPFDoEvents.SetHourglassCursor();

            SafeThreadPool.QueueUserWorkItem(o =>
            {
                //
                // Explicitly instruct the sync info collector to perform a swift scan, which DOES NOT include
                // collecting the precise size of every document in every Qiqqa library (which itself is a *significant*
                // file system load when you have any reasonably large libraries like I do.          [GHo]
                //
                // TODO: fetch and cache document filesizes in the background, so we can improve on the accuracy
                // of our numbers in a future call to this method.
                //
                GlobalSyncDetail global_sync_detail = GenerateGlobalSyncDetail(tally_library_storage_size: false);
                WPFDoEvents.InvokeInUIThread(() =>
                {
                    WPFDoEvents.ResetHourglassCursor();

                    SyncControlGridItemSet scgis = new SyncControlGridItemSet(sync_request, global_sync_detail);
                    scgis.AutoTick();

                    if (scgis.CanRunWithoutIntervention() && !user_wants_intervention)
                    {
                        Sync(scgis);
                    }
                    else
                    {
                        SyncControl sync_control = new SyncControl();
                        sync_control.SetSyncParameters(scgis);
                        sync_control.Show();
                    }
                });
            });
        }