Example #1
0
        // Done in UI thread after DoPerformSync completes

        private void PerformSyncCompleted()
        {
            Debug.Assert(System.Windows.Forms.Application.MessageLoop);

            if (syncstate.edsm_fullsync_count > 0 || syncstate.edsm_updatesync_count > 0)
            {
                LogLine(string.Format("EDSM update complete with {0} systems".Tx(this, "EDSMU"), syncstate.edsm_fullsync_count + syncstate.edsm_updatesync_count));
            }

            if (syncstate.eddb_sync_count > 0)
            {
                LogLine(string.Format("EDDB update complete with {0} systems".Tx(this, "EDDBU"), syncstate.eddb_sync_count));
            }

            long totalsystems = SystemClassDB.GetTotalSystems();

            LogLineSuccess(string.Format("Loading completed, total of {0:N0} systems stored".Tx(this, "SYST"), totalsystems));

            if (syncstate.edsm_fullsync_count > 0 || syncstate.eddb_sync_count > 0 || syncstate.edsm_updatesync_count > 20000)   // if we have done a resync, or a major update sync (arb no)
            {
                LogLine("Refresh due to updating EDSM or EDDB data".Tx(this, "Refresh"));
                RefreshHistoryAsync();
            }

            OnSyncComplete?.Invoke();

            ReportSyncProgress(-1, "");

            resyncEDSMEDDBRequestedFlag = 0;        // releases flag and allow another async to happen

            Debug.WriteLine(BaseUtils.AppTicks.TickCountLap() + " Perform sync completed");
        }
        private void PerformSyncCompleted()
        {
            ReportProgress(-1, "");

            if (!PendingClose)
            {
                long totalsystems = SystemClassDB.GetTotalSystems();
                LogLineSuccess("Loading completed, total of " + totalsystems + " systems");

                if (syncstate.performhistoryrefresh)
                {
                    LogLine("Refresh due to updating systems");
                    HistoryRefreshed += HistoryFinishedRefreshing;
                    RefreshHistoryAsync();
                }

                OnSyncComplete?.Invoke();

                resyncRequestedFlag = 0;
            }
        }
        private void PerformSyncCompleted()
        {
            ReportProgress(-1, "");

            if (!PendingClose)
            {
                long totalsystems = SystemClassDB.GetTotalSystems();
                LogLineSuccess($"Loading completed, total of {totalsystems:N0} systems");

                if (syncstate.performhistoryrefresh)
                {
                    LogLine("Refresh due to updating systems");
                    HistoryRefreshed += HistoryFinishedRefreshing;
                    RefreshHistoryAsync();
                }

                OnSyncComplete?.Invoke();

                resyncRequestedFlag = 0;
            }
            Debug.WriteLine(BaseUtils.AppTicks.TickCount100 + " Perform sync completed");
        }