public FilePath GetValidFormatName(object obj, FilePath fileName) { if (slnFileFormat.CanWriteFile(obj, this)) { return(slnFileFormat.GetValidFormatName(obj, fileName, this)); } else { string ext = MSBuildProjectService.GetExtensionForItem((SolutionEntityItem)obj); if (!string.IsNullOrEmpty(ext)) { return(fileName.ChangeExtension("." + ext)); } else { return(fileName); } } }