Esempio n. 1
0
        public void UpdateNavigationSettings(INavigationService navigationService, Settings settings)
        {
            if (navigationService == null)
            {
                throw new ArgumentNullException("navigationService");
            }

            if (settings == null)
            {
                throw new ArgumentNullException("settings");
            }

            INavigatorManager        primaryNavigatorManager    = CreateNavigatorManager(settings.PrimaryNavigator, settings);
            List <INavigatorManager> supportedNavigatorManagers = CreateSupportedNavigatorManagers(settings, primaryNavigatorManager);

            navigationService.PrimaryNavigatorManager    = primaryNavigatorManager;
            navigationService.SupportedNavigatorManagers = supportedNavigatorManagers;

            CachedFileSystemParser parser = navigationService.FileSystemParser as CachedFileSystemParser;

            if (parser != null)
            {
                parser.ExcludeFolderTemplates = settings.ExcludeFolderTemplates;
                parser.FoldersToParse         = settings.FoldersToParse;
            }

            //Warming up (to fill caches, etc)
            navigationService.GetFolderMatches("temp");
        }
Esempio n. 2
0
        private IFileSystemParser CreateParser(Settings settings)
        {
            //Don't use the same file system parser for cachedParser and AsyncFileSystemParser,
            //as AsyncFileSystemParser will operate on a different thread.
            IFileSystemParser basicParser     = new FileSystemParser(new FileSystemListener());
            ICacheSerializer  cacheSerializer = new CacheSerializer();
            IFileSystemParser cachedParser    = new CachedFileSystemParser(basicParser,
                                                                           cacheSerializer,
                                                                           new FileSystemListener(),
                                                                           new RegistryService(),
                                                                           new AsyncFileSystemParser(new FileSystemParser(new FileSystemListener())),
                                                                           _appRunOnStartup);

            cachedParser.ExcludeFolderTemplates = settings.ExcludeFolderTemplates;
            cachedParser.FoldersToParse         = settings.FoldersToParse;

            return(cachedParser);
        }
        private IFileSystemParser CreateParser(Settings settings)
        {
            //Don't use the same file system parser for cachedParser and AsyncFileSystemParser,
            //as AsyncFileSystemParser will operate on a different thread.
            IFileSystemParser basicParser = new FileSystemParser(new FileSystemListener());
            ICacheSerializer cacheSerializer = new CacheSerializer();
            IFileSystemParser cachedParser = new CachedFileSystemParser(basicParser,
                                                                        cacheSerializer,
                                                                        new FileSystemListener(),
                                                                        new RegistryService(),
                                                                        new AsyncFileSystemParser(new FileSystemParser(new FileSystemListener())),
                                                                        _appRunOnStartup);

            cachedParser.ExcludeFolderTemplates = settings.ExcludeFolderTemplates;
            cachedParser.FoldersToParse = settings.FoldersToParse;

            return cachedParser;
        }