コード例 #1
0
ファイル: Settings.cs プロジェクト: skazz0r/eve-plh
        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);
        }