public static void BackupFiles(string selectedNode, string path, string baseInputPath) { DateTime dt = DateTime.Now; StatusStripControl.InitStatusStrip(string.Empty, fileList.Count); //todo: criar caminhos relativos? var i = 1; var newLIst = fileList.ToList(); if (!string.IsNullOrEmpty(selectedNode)) { newLIst.RemoveAll(u => !u.Contains(selectedNode)); } newLIst.Sort(); foreach (var file in newLIst) { StatusStripControl.UpdateProgressBar(); StatusStripControl.UpdateLabel($"{i++}/{found} - {file}"); var fileFolder = FS.GetFolderName(file).Replace(baseInputPath + "\\", ""); fileFolder = FS.PathCombine(path, fileFolder); if (!FS.FolderExists(fileFolder)) { FS.CreateFolder(fileFolder); } FS.CopyFileIfNewer(file, FS.PathCombine(path, fileFolder)); } StatusStripControl.UpdateLabel($"{found} {UI.GetExtensionName()} files backup completed in {DateTime.Now.Subtract(dt).TotalSeconds.ToString("#.#")} seconds"); found = 0; if (string.IsNullOrEmpty(selectedNode)) { fileList.Clear(); } }