Пример #1
0
        public void EnsureUpdatedStandings()
        {
            var activeProfile = EveLocalChatAnalyser.Properties.ActiveProfile.Default;

            var hasAPIKey = activeProfile.KeyId > 0 && activeProfile.VCode.Length == VCODE_LENGTH;

            if (hasAPIKey && (activeProfile.KeyId != activeProfile.LastUpdateKeyId || AreStandingsOutdated(activeProfile)))
            {
                if (String.IsNullOrEmpty(activeProfile.CharacterId) || activeProfile.KeyId != activeProfile.LastUpdateKeyId)
                {
                    var keyIdStr = activeProfile.KeyId.ToString(CultureInfo.InvariantCulture);
                    activeProfile.CharacterId = ApiKeyInfoService.GetCharacterId(keyIdStr, activeProfile.VCode);
                }

                DateTime cachedUntil;
                activeProfile.Standings =
                    EveStandingsApiService.GetStandings(
                        activeProfile.CharacterId.ToString(CultureInfo.InvariantCulture),
                        activeProfile.KeyId,
                        activeProfile.VCode,
                        out cachedUntil);

                activeProfile.LastUpdateKeyId      = activeProfile.KeyId;
                activeProfile.StandingsCachedUntil = cachedUntil;
            }
        }
Пример #2
0
        private void CheckStandingInformation()
        {
            var isShowingBlues = !HideBlues.IsChecked.GetValueOrDefault();

            if (isShowingBlues)
            {
                return;
            }

            ActiveProfile.Default.CharacterId = ApiKeyInfoService.GetCharacterId(TxtKeyId.Text, TxtVCode.Text);
        }