コード例 #1
0
        public virtual SolutionItemConfiguration FindBestMatch(SolutionItemConfigurationCollection configurations)
        {
            var configs = configurations.Cast <SolutionItemConfiguration> ();

            return(configs.FirstOrDefault(c => Name == c.Name && Platform == c.Platform)
                   ?? configs.FirstOrDefault(c => Name == c.Name && (c.Platform == "" || c.Platform == "Any CPU")));
        }
コード例 #2
0
 public SolutionEntityItem()
 {
     items          = new ProjectItemCollection(this);
     thisItemArgs   = new SolutionItemEventArgs(this);
     configurations = new SolutionItemConfigurationCollection(this);
     configurations.ConfigurationAdded   += new ConfigurationEventHandler(OnConfigurationAddedToCollection);
     configurations.ConfigurationRemoved += new ConfigurationEventHandler(OnConfigurationRemovedFromCollection);
     Counters.ItemsLoaded++;
     fileStatusTracker = new FileStatusTracker <SolutionItemEventArgs> (this, OnReloadRequired, new SolutionItemEventArgs(this));
 }
コード例 #3
0
        public override SolutionItemConfiguration FindBestMatch(SolutionItemConfigurationCollection configurations)
        {
            // Get all configurations with the same value for the 'DEBUG' symbol
            var matches = configurations.OfType <DotNetProjectConfiguration> ().Where(c =>
                                                                                      c.CompilationParameters.HasDefineSymbol("DEBUG") == compilationParameters.HasDefineSymbol("DEBUG")
                                                                                      ).ToArray();

            // If the base method can't find a direct match then try to match based on finding a configuration
            // with a matching value for the 'DEBUG' symbol and some other heuristics
            return(base.FindBestMatch(configurations)
                   ?? matches.FirstOrDefault(c => Platform == c.Platform)
                   ?? matches.FirstOrDefault(c => c.Platform == ""));
        }