コード例 #1
0
        void UpdateCombos()
        {
            if (settingGlobalConfig)
            {
                return;
            }

            TrackStartupProject();
            configurationMergers = new Dictionary <SolutionItem, ConfigurationMerger> ();
            foreach (var project in startupProjects)
            {
                var configurationMerger = new ConfigurationMerger();
                configurationMerger.Load(currentSolution, project.Item1, project.Item2);
                configurationMergers [project.Item1] = configurationMerger;
            }

            ignoreConfigurationChangedCount++;
            try {
                if (!IdeApp.Workspace.IsOpen)
                {
                    ToolbarView.ConfigurationModel      = Enumerable.Empty <IConfigurationModel> ();
                    ToolbarView.RuntimeModel            = Enumerable.Empty <IRuntimeModel> ();
                    ToolbarView.RunConfigurationModel   = Enumerable.Empty <IRunConfigurationModel> ();
                    ToolbarView.RunConfigurationVisible = false;
                    return;
                }
                if (configurationMergers.Count == 1)
                {
                    ToolbarView.ConfigurationModel = configurationMergers.First().Value.SolutionConfigurations
                                                     .Distinct()
                                                     .Select(conf => new ConfigurationModel(conf));
                }
                else
                {
                    ToolbarView.ConfigurationModel = currentSolution?.Configurations.OfType <SolutionConfiguration> ()
                                                     .Select(conf => new ConfigurationModel(conf.Id)) ?? new ConfigurationModel [0];
                }

                if (currentSolution != null)
                {
                    ToolbarView.RunConfigurationModel = currentSolution.GetRunConfigurations().Select(rc => new RunConfigurationModel(rc)).ToArray();
                }
                else
                {
                    ToolbarView.RunConfigurationModel = Enumerable.Empty <IRunConfigurationModel> ();
                }
            } finally {
                ignoreConfigurationChangedCount--;
            }

            ToolbarView.RunConfigurationVisible = ToolbarView.RunConfigurationModel.Count() > 1;

            SelectActiveRunConfiguration();
            FillRuntimes();
            SelectActiveConfiguration();
        }
コード例 #2
0
		void UpdateCombos ()
		{
			if (settingGlobalConfig)
				return;

			TrackStartupProject ();
			configurationMergers = new Dictionary<SolutionItem, ConfigurationMerger> ();
			foreach (var project in startupProjects) {
				var configurationMerger = new ConfigurationMerger ();
				configurationMerger.Load (currentSolution, project.Item1, project.Item2);
				configurationMergers [project.Item1] = configurationMerger;
			}

			ignoreConfigurationChangedCount++;
			try {
				if (!IdeApp.Workspace.IsOpen) {
					ToolbarView.ConfigurationModel = Enumerable.Empty<IConfigurationModel> ();
					ToolbarView.RuntimeModel = Enumerable.Empty<IRuntimeModel> ();
					ToolbarView.RunConfigurationModel = Enumerable.Empty<IRunConfigurationModel> ();
					ToolbarView.RunConfigurationVisible = false;
					return;
				}
				if (configurationMergers.Count == 1)
					ToolbarView.ConfigurationModel = configurationMergers.First ().Value.SolutionConfigurations
						.Distinct ()
						.Select (conf => new ConfigurationModel (conf));
				else
					ToolbarView.ConfigurationModel = currentSolution?.Configurations.OfType<SolutionConfiguration> ()
						.Select (conf => new ConfigurationModel (conf.Id)) ?? new ConfigurationModel [0];

				if (currentSolution != null)
					ToolbarView.RunConfigurationModel = currentSolution.GetRunConfigurations ().Select (rc => new RunConfigurationModel (rc)).ToArray ();
				else
					ToolbarView.RunConfigurationModel = Enumerable.Empty<IRunConfigurationModel> ();
				
			} finally {
				ignoreConfigurationChangedCount--;
			}

			ToolbarView.RunConfigurationVisible = ToolbarView.RunConfigurationModel.Count () > 1;

			SelectActiveRunConfiguration ();
			FillRuntimes ();
			SelectActiveConfiguration ();
		}