예제 #1
0
        private async Task <Account> GetAccount()
        {
            Account data = null;

            try
            {
                UserCache.Clear(HistoryAddressesCacheKey);
                UserCache.Clear(FavoriteAddressesCacheKey);

                var account = await UseServiceClientAsync <IAccountServiceClient, Account>(service => service.GetMyAccount());

                if (account != null)
                {
                    CurrentAccount = account;
                    data           = account;
                }
            }
            catch (WebException ex)
            {
                Mvx.Resolve <IErrorHandler>().HandleError(ex);
            }
            catch (Exception ex)
            {
                Logger.LogError(ex);
            }

            return(data);
        }
예제 #2
0
        public async void RefreshCache(bool reload)
        {
            UserCache.Clear(HistoryAddressesCacheKey);
            UserCache.Clear(FavoriteAddressesCacheKey);

            if (reload)
            {
                await Task.WhenAll(GetFavoriteAddresses(), GetHistoryAddresses());
            }
        }
예제 #3
0
 public void ClearReferenceData()
 {
     UserCache.Clear(RefDataCacheKey);
 }