Example #1
0
        private void CalculateProjectConfigurationPlatforms()
        {
            GlobalSection section = this.FindSection("ProjectConfigurationPlatforms");

            if (section == null)
            {
                section = new GlobalSection("GlobalSection(ProjectConfigurationPlatforms) = postSolution");
                this._sections.Add(section);
            }
            section.Properties.Clear();
            BuildConfiguration[] configurations = this.Configurations().ToArray <BuildConfiguration>();
            GenericEnumerableExtensions.Each <SolutionProject>(from x in this._projects
                                                               where x.ProjectName != "Solution Items"
                                                               select x, delegate(SolutionProject proj)
            {
                GenericEnumerableExtensions.Each <BuildConfiguration>(configurations, delegate(BuildConfiguration config)
                {
                    config.WriteProjectConfiguration(proj, section);
                });
            });
            if (section.Empty)
            {
                this._sections.Remove(section);
            }
        }
Example #2
0
        private void InitializeFromSolution(CsProjFile projFile, Solution solution)
        {
            GlobalSection tfsSourceControl = solution.Sections.FirstOrDefault((GlobalSection section) => section.SectionName.Equals("TeamFoundationVersionControl"));

            if (tfsSourceControl != null)
            {
                this.InitializeTfsSourceControlSettings(projFile, solution, tfsSourceControl);
            }
        }
Example #3
0
 private void lookForGlobalSection(string text)
 {
     text = text.Trim();
     if (text.Trim().StartsWith("GlobalSection"))
     {
         this._section = new GlobalSection(text);
         this._parent._sections.Add(this._section);
         this._read = new Action <string>(this.readSection);
     }
 }
Example #4
0
        public IEnumerable <BuildConfiguration> Configurations()
        {
            GlobalSection section = this.FindSection("SolutionConfigurationPlatforms");

            if (section != null)
            {
                return(from x in section.Properties
                       select new BuildConfiguration(x));
            }
            return(Enumerable.Empty <BuildConfiguration>());
        }
Example #5
0
 public void WriteProjectConfiguration(SolutionProject solutionProject, GlobalSection section)
 {
     section.Read(FubuCore.StringExtensions.ToFormat("\t\t{{{0}}}.{1}.ActiveCfg = {2}", new object[]
     {
         solutionProject.ProjectGuid.ToString().ToUpper(),
         this.Key,
         this.Value
     }));
     section.Read(FubuCore.StringExtensions.ToFormat("\t\t{{{0}}}.{1}.Build.0 = {2}", new object[]
     {
         solutionProject.ProjectGuid.ToString().ToUpper(),
         this.Key,
         this.Value
     }));
 }
Example #6
0
        private void InitializeTfsSourceControlSettings(CsProjFile projFile, Solution solution, GlobalSection tfsSourceControl)
        {
            string projUnique = tfsSourceControl.Properties.FirstOrDefault((string item) => item.EndsWith(Path.GetFileName(projFile.FileName)));

            if (projUnique == null)
            {
                return;
            }
            int index = Convert.ToInt32(projUnique.Substring("SccProjectUniqueName".Length, projUnique.IndexOf('=') - "SccProjectUniqueName".Length).Trim());

            projFile.SourceControlInformation = new SourceControlInformation(tfsSourceControl.Properties.First((string item) => item.StartsWith("SccProjectUniqueName" + index)).Split(new char[]
            {
                '='
            })[1].Trim(), tfsSourceControl.Properties.First((string item) => item.StartsWith("SccProjectName" + index)).Split(new char[]
            {
                '='
            })[1].Trim(), tfsSourceControl.Properties.First((string item) => item.StartsWith("SccLocalPath" + index)).Split(new char[]
            {
                '='
            })[1].Trim());
        }