public async Task<UserSettings> GetCurrent() {
            var hasVersions = false;
            try {
                var index = await _cacheManager.GetIndex();
                hasVersions = index.Versions.Any();
            } catch (KeyNotFoundException ex) {}

            var appVersion = Common.App.ApplicationVersion;
            if (hasVersions)
                return await _cacheManager.Get(appVersion);
            var settings = new LegacyUserSettingsStorage(_dialogManager).TryLoadSettings();
            settings.Version = appVersion;
            return settings;
        }
Пример #2
0
        public async Task <UserSettings> GetCurrent()
        {
            var hasVersions = false;

            try {
                var index = await _cacheManager.GetIndex();

                hasVersions = index.Versions.Any();
            } catch (KeyNotFoundException ex) {}

            var appVersion = Common.App.ApplicationVersion;

            if (hasVersions)
            {
                return(await _cacheManager.Get(appVersion));
            }
            var settings = new LegacyUserSettingsStorage(_dialogManager).TryLoadSettings();

            settings.Version = appVersion;
            return(settings);
        }