Exemple #1
0
        private static void SpiderFolders(object state)
        {
            var fileService = new FileService();

            var gameRepository = new XmlConfigurationService(@".\config.xml");

            var backupRoot = ConfigurationManager.AppSettings["Destination Folder"] ?? Directory.GetCurrentDirectory();

            var fileRepository = new FileRepository(fileService, backupRoot);

            var folders = gameRepository.GetFolders();

            foreach (var game in folders)
            {
                try
                {
                    fileRepository.EnsureFolderLink(game);
                }
                catch (Exception ex)
                {
                    Console.WriteLine("Error syncing {0}: {1}", game.Name, ex.Message);
                }
            }
        }