예제 #1
0
 string FindItemConfiguration(List <IExtendedDataItem> chain, string configId)
 {
     for (int n = 0; n < chain.Count - 1; n++)
     {
         CombineConfigurationSet configs = (CombineConfigurationSet)chain[n].ExtendedProperties ["Configurations"];
         if (configs == null)
         {
             return(null);
         }
         SolutionItem         item          = (SolutionItem)chain [n + 1];
         CombineConfiguration combineConfig = configs.GetConfig(configId);
         if (combineConfig == null)
         {
             monitor.ReportWarning("Configuration '" + configId + "' not found in solution item '" + item.Name + "'.");
             return(null);
         }
         string mappedConfigId = combineConfig.GetMappedConfig(item.Name);
         if (mappedConfigId == null)
         {
             return(null);
         }
         if (mappedConfigId != string.Empty)
         {
             configId = mappedConfigId;
         }
     }
     return(configId);
 }
예제 #2
0
        void CreateCombineConfigurations(SolutionFolder folder)
        {
            IDictionary extendedProperties = folder.ExtendedProperties;

            CombineConfigurationSet configs = CreateCombineConfigurationSet(folder.ParentSolution, folder.IsRoot);

            configs.Active = folder.ParentSolution.DefaultConfigurationId;

            extendedProperties ["Configurations"] = configs;

            foreach (SolutionItem it in folder.Items)
            {
                if (it is SolutionFolder)
                {
                    foreach (SolutionConfiguration conf in folder.ParentSolution.Configurations)
                    {
                        CombineConfiguration      cc = configs.GetConfig(conf.Id);
                        CombineConfigurationEntry ce = new CombineConfigurationEntry(it.Name, true, conf.Id);
                        cc.Entries.Add(ce);
                    }
                    CreateCombineConfigurations((SolutionFolder)it);
                }
                else if (it is SolutionEntityItem)
                {
                    SolutionEntityItem sit = (SolutionEntityItem)it;
                    foreach (SolutionConfiguration conf in folder.ParentSolution.Configurations)
                    {
                        CombineConfiguration       cc  = configs.GetConfig(conf.Id);
                        SolutionConfigurationEntry sce = conf.GetEntryForItem(sit);
                        CombineConfigurationEntry  ce  = null;
                        if (sce == null)
                        {
                            ce = new CombineConfigurationEntry(it.Name, true, conf.Id);
                        }
                        else
                        {
                            ce = new CombineConfigurationEntry(it.Name, sce.Build, sce.ItemConfiguration);
                        }
                        cc.Entries.Add(ce);
                    }
                }
            }
        }