Пример #1
0
        public async Task <bool> IsValid(string key)
        {
            var name = typeof(T).Name;

            if (EveCache.Cache.Contains(name))
            {
                return(!Network.HasInternetConnection || await EveUtils.GetServerStatusAsync() != EveServerStatus.Online || EveCache.Cache[name].CachedUntil.ToLocalTime() > DateTime.Now);
            }

            return(!Network.HasInternetConnection || await EveUtils.GetServerStatusAsync() != EveServerStatus.Online);
        }
        public override async Task <bool> IsValid(string key)
        {
            var filename = key + ".cache";

            if (await ApplicationData.Current.LocalFolder.ExistsAsync(filename))
            {
                var file = await ApplicationData.Current.LocalFolder.GetFileAsync(filename);

                return(!Network.HasInternetConnection ||
                       await EveUtils.GetServerStatusAsync() != EveServerStatus.Online ||
                       (await file.GetDateModifiedAsync()).ToLocalTime().AddMinutes(5.0) > DateTime.Now);
            }

            return(true);
        }