private Guid?GetProjectTypeGuidFromProjectTypeEnum(SolutionProjectType solutionProjectType)
        {
            if (solutionProjectType == SolutionProjectType.ManagedCsProject)
            {
                return(csProjectGuid);
            }

            if (solutionProjectType == SolutionProjectType.ManagedVbProject)
            {
                return(vbProjectGuid);
            }

            if (solutionProjectType == SolutionProjectType.ManagedVjProject)
            {
                return(vjProjectGuid);
            }

            if (solutionProjectType == SolutionProjectType.SolutionFolder)
            {
                return(solutionFolderGuid);
            }

            if (solutionProjectType == SolutionProjectType.VCProject)
            {
                return(vcProjectGuid);
            }

            if (solutionProjectType == SolutionProjectType.WebProject)
            {
                return(webProjectGuid);
            }

            return(null);
        }
Пример #2
0
 internal ProjectInSolution(SolutionParser solution)
 {
     this.projectType             = SolutionProjectType.Unknown;
     this.projectName             = (string)null;
     this.relativePath            = (string)null;
     this.projectGuid             = (string)null;
     this.dependencies            = new ArrayList();
     this.projectReferences       = new ArrayList();
     this.parentProjectGuid       = (string)null;
     this.uniqueProjectName       = (string)null;
     this.parentSolution          = solution;
     this.dependencyLevel         = -1;
     this.isStaticLibrary         = false;
     this.childReferencesGathered = false;
     this.targetFrameworkMoniker  = ".NETFramework,Version=v3.5";
     this.aspNetConfigurations    = new Hashtable((IEqualityComparer)StringComparer.OrdinalIgnoreCase);
     this.projectConfigurations   = new Dictionary <string, ProjectConfigurationInSolution>((IEqualityComparer <string>)StringComparer.OrdinalIgnoreCase);
 }
Пример #3
0
        internal ProjectInSolution(SolutionParser solution)
        {
            projectType             = SolutionProjectType.Unknown;
            projectName             = null;
            relativePath            = null;
            projectGuid             = null;
            dependencies            = new ArrayList();
            projectReferences       = new ArrayList();
            parentProjectGuid       = null;
            uniqueProjectName       = null;
            parentSolution          = solution;
            dependencyLevel         = ProjectInSolution.DependencyLevelUnknown;
            isStaticLibrary         = false;
            childReferencesGathered = false;

            // This hashtable stores a AspNetCompilerParameters struct for each configuration name supported.
            aspNetConfigurations = new Hashtable(StringComparer.OrdinalIgnoreCase);

            projectConfigurations = new Dictionary <string, ProjectConfigurationInSolution>(StringComparer.OrdinalIgnoreCase);
        }
Пример #4
0
        internal ProjectInSolution(SolutionFile solution)
        {
            _projectType       = SolutionProjectType.Unknown;
            _projectName       = null;
            _relativePath      = null;
            _projectGuid       = null;
            _dependencies      = new List <string>();
            _projectReferences = new ArrayList();
            _parentProjectGuid = null;
            _uniqueProjectName = null;
            _parentSolution    = solution;

            // default to .NET Framework 3.5 if this is an old solution that doesn't explicitly say.
            _targetFrameworkMoniker = ".NETFramework,Version=v3.5";

            // This hashtable stores a AspNetCompilerParameters struct for each configuration name supported.
            _aspNetConfigurations = new Hashtable(StringComparer.OrdinalIgnoreCase);

            _projectConfigurations = new Dictionary <string, ProjectConfigurationInSolution>(StringComparer.OrdinalIgnoreCase);
        }
Пример #5
0
        internal ProjectInSolution(SolutionFile solution)
        {
            _projectType = SolutionProjectType.Unknown;
            _projectName = null;
            _relativePath = null;
            _projectGuid = null;
            _dependencies = new List<string>();
            _projectReferences = new ArrayList();
            _parentProjectGuid = null;
            _uniqueProjectName = null;
            _parentSolution = solution;

            // default to .NET Framework 3.5 if this is an old solution that doesn't explicitly say.
            _targetFrameworkMoniker = ".NETFramework,Version=v3.5";

            // This hashtable stores a AspNetCompilerParameters struct for each configuration name supported.
            _aspNetConfigurations = new Hashtable(StringComparer.OrdinalIgnoreCase);

            _projectConfigurations = new Dictionary<string, ProjectConfigurationInSolution>(StringComparer.OrdinalIgnoreCase);
        }
Пример #6
0
 internal ProjectInSolution(SolutionParser solution)
 {
   this.projectType = SolutionProjectType.Unknown;
   this.projectName = (string) null;
   this.relativePath = (string) null;
   this.projectGuid = (string) null;
   this.dependencies = new ArrayList();
   this.projectReferences = new ArrayList();
   this.parentProjectGuid = (string) null;
   this.uniqueProjectName = (string) null;
   this.parentSolution = solution;
   this.dependencyLevel = -1;
   this.isStaticLibrary = false;
   this.childReferencesGathered = false;
   this.targetFrameworkMoniker = ".NETFramework,Version=v3.5";
   this.aspNetConfigurations = new Hashtable((IEqualityComparer) StringComparer.OrdinalIgnoreCase);
   this.projectConfigurations = new Dictionary<string, ProjectConfigurationInSolution>((IEqualityComparer<string>) StringComparer.OrdinalIgnoreCase);
 }
        /// <summary>
        /// Initializes a new instance of <see cref="SolutionProject"/>.
        /// </summary>
        /// <param name="projectGuid">The guid of the project.</param>
        /// <param name="csProjFilePath">The project file path.</param>
        /// <param name="solutionFilePath">The solution file path.</param>
        /// <param name="projectType">The project type.</param>
        public SolutionProject(Guid projectGuid, string csProjFilePath, string solutionFilePath, SolutionProjectType projectType)
        {
            this.ProjectGuid       = projectGuid;
            this.ProjectName       = Path.GetFileName(csProjFilePath);
            this.ProjectType       = projectType;
            this.SolutionFilePath  = solutionFilePath;
            this.SolutionDirectory = Path.GetDirectoryName(solutionFilePath);
            this.RelativePath      = Path.GetRelativePath(this.SolutionDirectory, csProjFilePath);
            this.AbsolutePath      = Path.Combine(this.SolutionDirectory, this.RelativePath);

            Guid?projectTypeGuid = GetProjectTypeGuidFromProjectTypeEnum(projectType);

            if (!projectTypeGuid.HasValue)
            {
                throw new Exception(string.Format("Cannot find project type guid for project type {0}", projectType));
            }
            this.ProjectTypeGuid = projectTypeGuid.Value;
        }
Пример #8
0
        internal ProjectInSolution(SolutionParser solution)
        {
            projectType = SolutionProjectType.Unknown;
            projectName = null;
            relativePath = null;
            projectGuid = null;
            dependencies = new ArrayList();
            projectReferences = new ArrayList();
            parentProjectGuid = null;
            uniqueProjectName = null;
            parentSolution = solution;
            dependencyLevel = ProjectInSolution.DependencyLevelUnknown;
            isStaticLibrary = false;
            childReferencesGathered = false;

            // This hashtable stores a AspNetCompilerParameters struct for each configuration name supported.
            aspNetConfigurations = new Hashtable(StringComparer.OrdinalIgnoreCase);

            projectConfigurations = new Dictionary<string, ProjectConfigurationInSolution>(StringComparer.OrdinalIgnoreCase);
        }