コード例 #1
0
        public SettingsManager(ICachemanager cachemanager)
        {
            _cachemanager       = cachemanager;
            BeginEditCommand    = new RelayCommand(BeginEdit, () => !IsEditing);
            CommitEditCommand   = new RelayCommand(CommitEdit, () => IsEditing);
            ResetDefaultCommand = new AsyncCommand(ResetDefault, () => IsEditing);
            CancelEditCommand   = new RelayCommand(CancelEdit, () => IsEditing);

            _fbd = new FolderBrowserDialog();
            SelectWorkingFolderCommand = new RelayCommand(SelectWorkingFolder);
            _commands = new[] { BeginEditCommand, CommitEditCommand, ResetDefaultCommand, CancelEditCommand };
            Cultures  = CultureInfo.GetCultures(CultureTypes.AllCultures & ~CultureTypes.NeutralCultures).ToList();
        }
コード例 #2
0
ファイル: App.xaml.cs プロジェクト: blaise-braye/my-accounts
        private static void SetupCache()
        {
            IRawCacheRepository repository;

            if (string.IsNullOrEmpty(Settings.Default.RedisConnectionString))
            {
                repository = new InMemoryRawCacheRepository();
            }
            else
            {
                repository = new RedisRawCacheRepository(Settings.Default.RedisConnectionString);
            }

            CacheManager = new CacheManager(repository);
            _log.Info($"Cache provider initialized, working with repository {repository.GetType()}");
        }