private static void Uninstall()
        {
            IRegistryService registryService = new RegistryService();
            ICacheSerializer cacheSerializer = new CacheSerializer();
            ISettingsSerializer settingsSerializer = new SettingsSerializer(registryService);

            cacheSerializer.DeleteCache();
            registryService.DeleteRunOnStartup();

            //Not sure, if it will be user-friendly; but i prefer if applications remove themselves completely,
            //especially small ones.
            settingsSerializer.DeleteSettings();
        }
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;
        }