public bool TryCreateNuGetProject( IVsProjectAdapter project, ProjectProviderContext context, bool forceProjectType, out NuGetProject result) { Assumes.Present(project); Assumes.Present(context); result = null; ThreadHelper.ThrowIfNotOnUIThread(); if (project.IsDeferred) { return(false); } var projectK = EnvDTEProjectUtility.GetProjectKPackageManager(project.Project); if (projectK == null) { return(false); } result = new ProjectKNuGetProject( projectK, project.ProjectName, project.CustomUniqueName, project.ProjectId); return(true); }
public async Task <NuGetProject> TryCreateNuGetProjectAsync( IVsProjectAdapter project, ProjectProviderContext context, bool forceProjectType) { Assumes.Present(project); Assumes.Present(context); await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(); if (project.IsDeferred) { return(null); } var projectK = EnvDTEProjectUtility.GetProjectKPackageManager(project.Project); if (projectK == null) { return(null); } return(new ProjectKNuGetProject( projectK, project.ProjectName, project.CustomUniqueName, project.ProjectId)); }