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; }