Пример #1
0
        private void TrySynchronizeMyPointsAndAchievements(IList <BuildStatus> changedBuildStatuses)
        {
            if (!changedBuildStatuses.Any(i => i.IsWorkingOrBroken()))
            {
                return;
            }
            var anyBuildsAreMine = changedBuildStatuses.Any(i => i.RequestedBy == _settings.MyRawName && i.IsWorkingOrBroken());

            if (!anyBuildsAreMine)
            {
                return;
            }
            var exportedBuilds   = SosDb.ExportNewBuilds(_settings);
            var noBuildsToExport = exportedBuilds == null;

            if (noBuildsToExport)
            {
                _log.Error("No builds were found to export from sosDb to sos online even though one was changed");
                return;
            }
            _log.Debug("Uploading the following builds to sos online: " + exportedBuilds);
            string exportedAchievements = _settings.ExportNewAchievements();

            SosOnlineService.Synchronize(_settings, exportedBuilds, exportedAchievements, OnAddBuildsSuccess, OnAddBuildsFail);
        }
Пример #2
0
        private void RefreshOfflinePanel()
        {
            _exportedBuilds.Text       = "";
            _exportedAchievements.Text = "";
            var sosDb          = new SosDb();
            var exportedBuilds = sosDb.ExportNewBuilds(_settings);

            if (exportedBuilds == null)
            {
                return;
            }
            string exportedAchievements = _settings.ExportNewAchievements();

            _exportedBuilds.Text       = exportedBuilds;
            _exportedAchievements.Text = exportedAchievements;
        }
Пример #3
0
        private void OnVerifyCredentialsSuccess()
        {
            _sosOnlineStatus.Text = "Login success, performing sync";

            var sosDb          = new SosDb();
            var exportedBuilds = sosDb.ExportNewBuilds(_settings);

            if (exportedBuilds == null)
            {
                ManualSyncComplete("No new builds to export", authenticatedSuccessfully: true);
                return;
            }
            string exportedAchievements = _settings.ExportNewAchievements();
            var    sosOnlineService     = new SosOnlineService();

            sosOnlineService.Synchronize(_settings, exportedBuilds, exportedAchievements, OnAddBuildsSuccess, OnSosOnlineFailure);
        }