static private GetExtensionForItem ( SolutionEntityItem item ) : string | ||
item | SolutionEntityItem | |
Résultat | string |
internal static string GetExtensionForItem (SolutionEntityItem item)
{
foreach (DotNetProjectSubtypeNode node in GetItemSubtypeNodes ()) {
if (!string.IsNullOrEmpty (node.Extension) && node.CanHandleItem (item))
return node.Extension;
}
foreach (ItemTypeNode node in GetItemTypeNodes ()) {
if (node.CanHandleItem (item)) {
return node.Extension;
}
}
// The generic handler should always be found
throw new InvalidOperationException ();
}
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); } } }