MonoDevelop.Projects.Formats.MSBuild.MSBuildProjectService.FindHandlerForFile C# (CSharp) Method

FindHandlerForFile() static private method

static private FindHandlerForFile ( FilePath file ) : ItemTypeNode
file FilePath
return ItemTypeNode
		internal static ItemTypeNode FindHandlerForFile (FilePath file)
		{
			foreach (ItemTypeNode node in GetItemTypeNodes ()) {
				if (node.CanHandleFile (file, null)) {
					return node;
				}
			}
			if (IsProjectSubtypeFile (file)) {
				string typeGuids = LoadProjectTypeGuids (file);
				foreach (ItemTypeNode node in GetItemTypeNodes ()) {
					if (node.CanHandleFile (file, typeGuids)) {
						return node;
					}
				}
			}
			return null;
		}
		

Usage Example

Exemplo n.º 1
0
 public bool CanReadFile(FilePath file, Type expectedType)
 {
     if (expectedType.IsAssignableFrom(typeof(Solution)) && slnFileFormat.CanReadFile(file, this))
     {
         return(true);
     }
     else if (expectedType.IsAssignableFrom(typeof(SolutionEntityItem)))
     {
         ItemTypeNode node = MSBuildProjectService.FindHandlerForFile(file);
         if (node == null)
         {
             return(false);
         }
         return(toolsVersion == ReadToolsVersion(file));
     }
     return(false);
 }