Exemple #1
0
        private void InitProjectType(object solutionProject)
        {
            var ProjectTypeValue = ReflectionTools.GetPropertyValue(ProjectInSolutionProjectType, solutionProject);

            switch (ProjectTypeValue.ToString())
            {
            case "Unknown":
                ProjectType = ProjectType.Unknown;
                break;

            case "KnownToBeMSBuildFormat":
                ProjectType = ProjectType.KnownToBeMSBuildFormat;
                break;

            case "SolutionFolder":
                ProjectType = ProjectType.SolutionFolder;
                break;

            case "WebProject":
                ProjectType = ProjectType.WebProject;
                break;

            case "WebDeploymentProject":
                ProjectType = ProjectType.WebDeploymentProject;
                break;

            case "EtpSubProject":
                ProjectType = ProjectType.EtpSubProject;
                break;

            default:
                ProjectType = ProjectType.Invalid;
                break;
            }
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="Configuration"/> class.
        /// </summary>
        /// <param name="project">The project containing the configuration.</param>
        /// <param name="solutionConfiguration">The configuration object.</param>
        /// <param name="configurationName">The configuration name.</param>
        /// <param name="platformName">The platform name.</param>
        internal Configuration(Project project, object solutionConfiguration, string configurationName, string platformName)
        {
            Project           = project;
            ConfigurationName = configurationName;
            PlatformName      = platformName;

            IncludeInBuild = (bool)ReflectionTools.GetPropertyValue(ProjectConfigurationInSolutionIncludeInBuild, solutionConfiguration);
        }
Exemple #3
0
 private void InitBasic(object solutionProject)
 {
     ProjectName     = (string)ReflectionTools.GetPropertyValue(ProjectInSolutionProjectName, solutionProject);
     RelativePath    = (string)ReflectionTools.GetPropertyValue(ProjectInSolutionRelativePath, solutionProject);
     ProjectGuid     = (string)ReflectionTools.GetPropertyValue(ProjectInSolutionProjectGuid, solutionProject);
     Extension       = (string)ReflectionTools.GetPropertyValue(ProjectInSolutionExtension, solutionProject);
     DependencyLevel = (int)ReflectionTools.GetPropertyValue(ProjectInSolutionDependencyLevel, solutionProject);
     IsStaticLibrary = (bool)ReflectionTools.GetPropertyValue(ProjectInSolutionIsStaticLibrary, solutionProject);
 }
Exemple #4
0
        private void Initialize(StreamReader reader)
        {
            ConstructorInfo Constructor    = ReflectionTools.GetFirstTypeConstructor(SolutionParserType);
            var             SolutionParser = Constructor.Invoke(null);

            SolutionParserReader.SetValue(SolutionParser, reader, null);
            SolutionParserParseSolution.Invoke(SolutionParser, null);

            Array ProjetctArray = (Array)ReflectionTools.GetPropertyValue(SolutionParserProjects, SolutionParser);

            for (int i = 0; i < ProjetctArray.Length; i++)
            {
                Contract.RequireNotNull(ProjetctArray.GetValue(i), out object SolutionProject);
                Project NewProject = new Project(this, SolutionProject);

                ProjectList.Add(NewProject);
            }
        }
Exemple #5
0
        private void InitConfigurations(object solutionProject)
        {
            System.Collections.IDictionary ProjectConfigurationsValue = (System.Collections.IDictionary)ReflectionTools.GetPropertyValue(ProjectInSolutionProjectConfigurations, solutionProject);
            List <Configuration>           ConfigurationList          = new();

            foreach (string Key in ProjectConfigurationsValue.Keys)
            {
                object?Value = ProjectConfigurationsValue[Key];

                string[] Splits = Key.Split('|');
                if (Splits.Length >= 2 && Value != null)
                {
                    string ConfigurationName = Splits[0];
                    string PlatformName      = Splits[1];
                    ConfigurationList.Add(new Configuration(this, Value, ConfigurationName, PlatformName));
                }
            }

            ProjectConfigurations = ConfigurationList.AsReadOnly();
        }
Exemple #6
0
        private void InitDependencies(object solutionProject)
        {
            System.Collections.IEnumerable DependenciesValue = (System.Collections.IEnumerable)ReflectionTools.GetPropertyValue(ProjectInSolutionDependencies, solutionProject);
            List <string> DependencyList = new();

            foreach (string Item in DependenciesValue)
            {
                DependencyList.Add(Item);
            }
            Dependencies = DependencyList.AsReadOnly();

            System.Collections.IEnumerable ProjectReferencesValue = (System.Collections.IEnumerable)ReflectionTools.GetPropertyValue(ProjectInSolutionProjectReferences, solutionProject);
            List <string> ProjectReferenceList = new();

            foreach (string Item in ProjectReferencesValue)
            {
                ProjectReferenceList.Add(Item);
            }
            ProjectReferences = ProjectReferenceList.AsReadOnly();

            object?ParentProjectGuidValue = ProjectInSolutionParentProjectGuid.GetValue(solutionProject);

            if (ParentProjectGuidValue != null)
            {
                ParentProjectGuid = (string)ParentProjectGuidValue;
            }
            else
            {
                ParentProjectGuid = string.Empty;
            }
        }