/// <summary> /// monitor folder by gettin files extension and choosing needed file mover /// </summary> /// <param name="folderPath"></param> public void MonitorFolder(string folderPath) { DirectoryInfo dirInfo = new DirectoryInfo(folderPath); foreach (FileInfo fileInfo in dirInfo.GetFiles()) { FileMover fileMover = FMDictionary.GetMover(fileInfo.Extension); fileMover.Move(fileInfo); } }
/// <summary> /// add new file mover /// </summary> /// <param name="ext"></param> /// <param name="fm"></param> public void Add(string ext, FileMover fm) { dictionary.Add(ext, fm); }