public Settings() { InitializeComponent(); _configuration = PhotoSync.GetConfiguration(); Exclusions = _configuration.AppSettings.Settings[nameof(Exclusions)].Value; Extensions = _configuration.AppSettings.Settings[nameof(Extensions)].Value; Period = _configuration.AppSettings.Settings[nameof(Period)].Value; SourceFolder = _configuration.AppSettings.Settings[nameof(SourceFolder)].Value; DestFolder = _configuration.AppSettings.Settings[nameof(DestFolder)].Value; }
static void Main(string[] args) { PhotoSync photoSync = new PhotoSync(); while (true) { SourceFolder = ConfigurationManager.AppSettings[nameof(SourceFolder)]; DestFolder = ConfigurationManager.AppSettings[nameof(DestFolder)]; Console.WriteLine("Начало сканирования каталога " + SourceFolder); Console.WriteLine("Папка-приёмник " + DestFolder); Console.WriteLine("Для остановки сканирования нажмите Enter"); photoSync.StartChecking(); Console.ReadLine(); photoSync.StopChecking(); Console.WriteLine("Для начала сканирования нажмите Enter"); Console.ReadLine(); } }
public PhotoSyncService() { InitializeComponent(); CanPauseAndContinue = true; _photoSync = new PhotoSync(); }