public override string GetParentFile(FileInfo fi, FileTaskType taskType) { if (ProTONEConfig.UseLinkedFiles) { // Check whether the child file is a double extension file // In this case the parent file should have same name but w/o the second extension part. string parentFilePath = Path.Combine(fi.DirectoryName, Path.GetFileNameWithoutExtension(fi.FullName)); if (File.Exists(parentFilePath)) return parentFilePath; string fileType = fi.Extension.ToUpperInvariant().Trim('.'); string[] parentFileTypes = ProTONEConfig.GetParentFileTypes(fileType); if (parentFileTypes != null && parentFileTypes.Length > 0) { foreach (string parentFileType in parentFileTypes) { parentFilePath = Path.ChangeExtension(fi.FullName, parentFileType); if (File.Exists(parentFilePath)) { return parentFilePath; } } } } return null; }
public override List<string> GetChildFiles(string file, FileTaskType taskType) { List<string> list = new List<string>(); if (ProTONEConfig.UseLinkedFiles) { string fileType = PathUtils.GetExtension(file).ToUpperInvariant(); string[] childFileTypes = ProTONEConfig.GetChildFileTypes(fileType); if (childFileTypes != null && childFileTypes.Length > 0) { foreach (string childFileType in childFileTypes) { // This will find files like "FileName.PFT" and change them into "FileName.CFT" string childFilePath = Path.ChangeExtension(file, childFileType); if (File.Exists(childFilePath) && !list.Contains(childFilePath)) { list.Add(childFilePath); } // This will find files like "FileName.PFT" and change them into "FileName.PFT.CFT" // (i.e. handle double type extension case like for Bookmark files) string childFileType2 = string.Format("{0}.{1}", PathUtils.GetExtension(file), childFileType); string childFilePath2 = Path.ChangeExtension(file, childFileType2); if (File.Exists(childFilePath2) && !list.Contains(childFilePath2)) { list.Add(childFilePath2); } } } } return list; }
public override List<string> GetChildFiles(FileInfo fi, FileTaskType taskType) { List<string> list = new List<string>(); if (ProTONEConfig.UseLinkedFiles) { string fileType = fi.Extension.ToUpperInvariant().Trim('.'); string[] childFileTypes = ProTONEConfig.GetChildFileTypes(fileType); if (childFileTypes != null && childFileTypes.Length > 0) { foreach (string childFileType in childFileTypes) { // This will find files like "FileName.PFT" and change them into "FileName.CFT" string childFilePath = Path.ChangeExtension(fi.FullName, childFileType); if (File.Exists(childFilePath) && !list.Contains(childFilePath)) { list.Add(childFilePath); } // This will find files like "FileName.PFT" and change them into "FileName.PFT.CFT" // (i.e. handle double type extension case like for Bookmark files) string childFileType2 = string.Format("{0}.{1}", fi.Extension, childFileType); string childFilePath2 = Path.ChangeExtension(fi.FullName, childFileType2); if (File.Exists(childFilePath2) && !list.Contains(childFilePath2)) { list.Add(childFilePath2); } } } } return list; }
public override string GetParentFile(string file, FileTaskType taskType) { if (ProTONEConfig.UseLinkedFiles) { string parentFilePath = ""; if (Path.HasExtension(file)) { // Check whether the child file is a double extension file // In this case the parent file should have same name but w/o the second extension part. parentFilePath = Path.Combine(Path.GetDirectoryName(file), Path.GetFileNameWithoutExtension(file)); if (File.Exists(parentFilePath)) return parentFilePath; } string fileType = Path.GetExtension(file).ToUpperInvariant(); string[] parentFileTypes = ProTONEConfig.GetParentFileTypes(fileType); if (parentFileTypes != null && parentFileTypes.Length > 0) { foreach (string parentFileType in parentFileTypes) { parentFilePath = Path.ChangeExtension(file, parentFileType); if (File.Exists(parentFilePath)) { return parentFilePath; } } } } return null; }
public FileTaskForm(FileTaskType type, List <string> srcFiles, string srcPath) { InitializeComponent(); _task = InitTask(type, srcFiles, srcPath); _task.FileTaskProgress += new FileTaskProgressDG(OnFileTaskProgress); this.Shown += new EventHandler(FileTaskForm_Shown); this.FormClosing += new FormClosingEventHandler(FileTaskForm_FormClosing); }
public FileTaskForm(FileTaskType type, List<string> srcFiles, string srcPath) { InitializeComponent(); _task = InitTask(type, srcFiles, srcPath); _task.FileTaskProgress += new FileTaskProgressDG(OnFileTaskProgress); this.Shown += new EventHandler(FileTaskForm_Shown); this.FormClosing += new FormClosingEventHandler(FileTaskForm_FormClosing); }
List <string> OnQueryLinkedFiles(string path, FileTaskType taskType) { FEFileTaskSupport support = new FEFileTaskSupport(null); if (File.Exists(path)) { return(support.GetChildFiles(path, taskType)); } return(null); }
public BaseFileTask(FileTaskType type, List <string> srcFiles, string srcFolder) { this.TaskType = type; this.ErrorMap = new Dictionary <string, string>(); this.SrcFiles = srcFiles; this.SrcFolder = srcFolder; _timer = new System.Timers.Timer(500); _timer.AutoReset = true; _timer.Elapsed += new System.Timers.ElapsedEventHandler(_timer_Elapsed); _support = InitSupport(); this.IsFinished = false; }
protected virtual BaseFileTask InitTask(FileTaskType type, List<string> srcFiles, string srcPath) { switch (type) { case FileTaskType.Copy: return new CopyFilesTask(srcFiles, srcPath); case FileTaskType.Move: return new MoveFilesTask(srcFiles, srcPath); case FileTaskType.Delete: return new DeleteFilesTask(srcFiles); } return null; }
protected virtual BaseFileTask InitTask(FileTaskType type, List <string> srcFiles, string srcPath) { switch (type) { case FileTaskType.Copy: return(new CopyFilesTask(srcFiles, srcPath)); case FileTaskType.Move: return(new MoveFilesTask(srcFiles, srcPath)); case FileTaskType.Delete: return(new DeleteFilesTask(srcFiles)); } return(null); }
protected override BaseFileTask InitTask(FileTaskType type, List<string> srcFiles, string srcPath) { switch (type) { case FileTaskType.Copy: return new FECopyFilesTask(srcFiles, srcPath); case FileTaskType.Move: return new FEMoveFilesTask(srcFiles, srcPath); case FileTaskType.Delete: return new FEDeleteFilesTask(srcFiles); } return null; }
public virtual List <string> GetChildFiles(string path, FileTaskType taskType) { return(null); }
public virtual List<string> GetChildFiles(FileInfo fi, FileTaskType taskType) { return null; }
public FEFileTaskForm(FileTaskType type, List<string> srcFiles, string srcPath) : base(type, srcFiles, srcPath) { }
public virtual string GetParentFile(FileInfo fi, FileTaskType taskType) { return null; }
List<string> OnQueryLinkedFiles(string path, FileTaskType taskType) { FEFileTaskSupport support = new FEFileTaskSupport(null); FileInfo fi = new FileInfo(path); if (fi != null && fi.Exists) { return support.GetChildFiles(fi, taskType); } return null; }
public virtual string GetParentFile(string path, FileTaskType taskType) { return(null); }
public FEFileTaskForm(FileTaskType type, List <string> srcFiles, string srcPath) : base(type, srcFiles, srcPath) { }
public BaseFileTask(FileTaskType type, List<string> srcFiles, string srcFolder) { this.TaskType = type; this.ErrorMap = new Dictionary<string, string>(); this.SrcFiles = srcFiles; this.SrcFolder = srcFolder; _timer = new System.Timers.Timer(500); _timer.AutoReset = true; _timer.Elapsed += new System.Timers.ElapsedEventHandler(_timer_Elapsed); _support = InitSupport(); this.IsFinished = false; }