コード例 #1
0
        public SchemeCache(StudioStylesService studioStylesServiceService)
        {
            StudioStylesService = studioStylesServiceService;

            IsCacheValid = false;
            IsCacheRefreshing = false;
            IsImageCacheRefreshing = false;
            CurrentSchemeNumber = 0;

            Schemes = new ObservableCollection<Scheme>();

            SchemesDataPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
                Path.Combine("Twainsoft", "StudioStyler"));

            if (!Directory.Exists(SchemesDataPath))
            {
                Directory.CreateDirectory(SchemesDataPath);
            }

            schemesCacheFile = "SchemesCache.xml";

            SchemesPreviewPath = Path.Combine(SchemesDataPath, "Previews");

            if (!Directory.Exists(SchemesPreviewPath))
            {
                Directory.CreateDirectory(SchemesPreviewPath);
            }
        }
コード例 #2
0
        public SchemeModel(SchemeCache schemeCache, SchemeHistory schemesHistory, OptionsStore optionsStore,
            StudioStylesService studioStylesService, SettingsActivator settingsActivator)
        {
            SchemeCache = schemeCache;
            SchemesHistory = schemesHistory;
            OptionsStore = optionsStore;
            StudioStylesService = studioStylesService;
            SettingsActivator = settingsActivator;

            var stylesPerPage = optionsStore.StylesPerPage;

            PagedSchemesView = new PagedCollectionView(SchemeCache.Schemes) { PageSize = stylesPerPage };
            PagedSchemesView.SortDescriptions.Add(new SortDescription("Rating", ListSortDirection.Descending));

            CurrentSearchString = "";
            SearchValues = new List<string>();
        }