Esempio n. 1
0
 private void lookForGlobalSection(string text)
 {
     text = text.Trim();
     if (text.Trim().StartsWith("GlobalSection"))
     {
         _section = new GlobalSection(text);
         _parent._sections.Add(_section);
         _read = readSection;
     }
 }
Esempio n. 2
0
        private void calculateProjectConfigurationPlatforms()
        {
            var section = FindSection(ProjectConfigurationPlatforms);

            if (section == null)
            {
                section = new GlobalSection("GlobalSection(ProjectConfigurationPlatforms) = postSolution");
                _sections.Add(section);
            }

            section.Properties.Clear();
            var configurations = Configurations().ToArray();

            _projects.Where(x => x.ProjectName != "Solution Items").Each(proj => {
                configurations.Each(config => config.WriteProjectConfiguration(proj, section));
            });

            if (section.Empty)
            {
                _sections.Remove(section);
            }
        }
 public void WriteProjectConfiguration(ProjectReference project, GlobalSection section)
 {
     section.Read("\t\t{{{0}}}.{1}.ActiveCfg = {2}".ToFormat(project.ProjectGuid.ToString().ToUpper(), Key, Value));
     section.Read("\t\t{{{0}}}.{1}.Build.0 = {2}".ToFormat(project.ProjectGuid.ToString().ToUpper(), Key, Value));
 }
Esempio n. 4
0
 private void lookForGlobalSection(string text)
 {
     text = text.Trim();
     if (text.Trim().StartsWith("GlobalSection"))
     {
         _section = new GlobalSection(text);
         _parent._sections.Add(_section);
         _read = readSection;
     }
 }
Esempio n. 5
0
        private void calculateProjectConfigurationPlatforms()
        {
            var section = FindSection(ProjectConfigurationPlatforms);
            if (section == null)
            {
                section = new GlobalSection("GlobalSection(ProjectConfigurationPlatforms) = postSolution");
                _sections.Add(section);
            }

            section.Properties.Clear();
            var configurations = Configurations().ToArray();

            _projects.Where(x => x.ProjectName != "Solution Items").Each(proj => {
                configurations.Each(config => config.WriteProjectConfiguration(proj, section));
            });
        }
        private void InitializeTfsSourceControlSettings(CsProjFile projFile, Solution solution, GlobalSection tfsSourceControl)
        {
            var projUnique = tfsSourceControl.Properties.FirstOrDefault(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(item => item.StartsWith("SccProjectUniqueName" + index)).Split('=')[1].Trim(),
                tfsSourceControl.Properties.First(item => item.StartsWith("SccProjectName" + index)).Split('=')[1].Trim(),
                tfsSourceControl.Properties.First(item => item.StartsWith("SccLocalPath" + index)).Split('=')[1].Trim());
        }
 public void WriteProjectConfiguration(SolutionProject solutionProject, GlobalSection section)
 {
     section.Read("\t\t{{{0}}}.{1}.ActiveCfg = {2}".ToFormat(solutionProject.ProjectGuid.ToString().ToUpper(), Key, Value));
     section.Read("\t\t{{{0}}}.{1}.Build.0 = {2}".ToFormat(solutionProject.ProjectGuid.ToString().ToUpper(), Key, Value));
 }
Esempio n. 8
0
        private void InitializeTfsSourceControlSettings(CsProjFile projFile, Solution solution, GlobalSection tfsSourceControl)
        {
            var projUnique = tfsSourceControl.Properties.FirstOrDefault(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(item => item.StartsWith("SccProjectUniqueName" + index)).Split('=')[1].Trim(),
                tfsSourceControl.Properties.First(item => item.StartsWith("SccProjectName" + index)).Split('=')[1].Trim(),
                tfsSourceControl.Properties.First(item => item.StartsWith("SccLocalPath" + index)).Split('=')[1].Trim());
        }