public static SolutionEntityItem LoadItem(IProgressMonitor monitor, string fileName, MSBuildFileFormat expectedFormat, string typeGuid, string itemGuid)
        {
            foreach (ItemTypeNode node in GetItemTypeNodes())
            {
                if (node.CanHandleFile(fileName, typeGuid))
                {
                    return(node.LoadSolutionItem(monitor, fileName, expectedFormat, itemGuid));
                }
            }

            if (string.IsNullOrEmpty(typeGuid) && IsProjectSubtypeFile(fileName))
            {
                typeGuid = LoadProjectTypeGuids(fileName);
                foreach (ItemTypeNode node in GetItemTypeNodes())
                {
                    if (node.CanHandleFile(fileName, typeGuid))
                    {
                        return(node.LoadSolutionItem(monitor, fileName, expectedFormat, itemGuid));
                    }
                }
            }

            // If it is a known unsupported project, load it as UnknownProject
            var projectInfo = MSBuildProjectService.GetUnknownProjectTypeInfo(typeGuid != null ? new [] { typeGuid } : new string[0], fileName);

            if (projectInfo != null && projectInfo.LoadFiles)
            {
                if (typeGuid == null)
                {
                    typeGuid = projectInfo.Guid;
                }
                var h = new MSBuildProjectHandler(typeGuid, "", itemGuid);
                h.SetUnsupportedType(projectInfo);
                return(h.Load(monitor, fileName, expectedFormat, "", null));
            }

            return(null);
        }
Пример #2
0
        public override SolutionEntityItem LoadSolutionItem(IProgressMonitor monitor, string fileName, MSBuildFileFormat expectedFormat, string itemGuid)
        {
            MSBuildProjectHandler handler = new MSBuildProjectHandler(Guid, Import, itemGuid);

            return(handler.Load(monitor, fileName, expectedFormat, null, null));
        }
Пример #3
0
        public override SolutionEntityItem LoadSolutionItem(IProgressMonitor monitor, string fileName, string itemGuid)
        {
            MSBuildProjectHandler handler = CreateHandler <MSBuildProjectHandler> (fileName, itemGuid);

            return(handler.Load(monitor, fileName, null, ItemType));
        }
Пример #4
0
		public override SolutionEntityItem LoadSolutionItem (IProgressMonitor monitor, string fileName, MSBuildFileFormat expectedFormat, string itemGuid)
		{
			MSBuildProjectHandler handler = new MSBuildProjectHandler (Guid, Import, itemGuid);
			return handler.Load (monitor, fileName, expectedFormat, null, null);
		}
Пример #5
0
		public static SolutionEntityItem LoadItem (IProgressMonitor monitor, string fileName, MSBuildFileFormat expectedFormat, string typeGuid, string itemGuid)
		{
			foreach (ItemTypeNode node in GetItemTypeNodes ()) {
				if (node.CanHandleFile (fileName, typeGuid))
					return node.LoadSolutionItem (monitor, fileName, expectedFormat, itemGuid);
			}
			
			if (string.IsNullOrEmpty (typeGuid) && IsProjectSubtypeFile (fileName)) {
				typeGuid = LoadProjectTypeGuids (fileName);
				foreach (ItemTypeNode node in GetItemTypeNodes ()) {
					if (node.CanHandleFile (fileName, typeGuid))
						return node.LoadSolutionItem (monitor, fileName, expectedFormat, itemGuid);
				}
			}

			// If it is a known unsupported project, load it as UnknownProject
			var projectInfo = MSBuildProjectService.GetUnknownProjectTypeInfo (typeGuid != null ? new [] { typeGuid } : new string[0], fileName);
			if (projectInfo != null && projectInfo.LoadFiles) {
				if (typeGuid == null)
					typeGuid = projectInfo.Guid;
				var h = new MSBuildProjectHandler (typeGuid, "", itemGuid);
				h.SetUnsupportedType (projectInfo);
				return h.Load (monitor, fileName, expectedFormat, "", null);
			}

			return null;
		}