当前位置: 首页>>代码示例>>C#>>正文


C# Solution.GetAllItems方法代码示例

本文整理汇总了C#中Solution.GetAllItems方法的典型用法代码示例。如果您正苦于以下问题:C# Solution.GetAllItems方法的具体用法?C# Solution.GetAllItems怎么用?C# Solution.GetAllItems使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Solution的用法示例。


在下文中一共展示了Solution.GetAllItems方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: StartupOptionsPanelWidget

		public StartupOptionsPanelWidget (Solution sol)
		{
			this.Build();
			this.sol = sol;
			
			startupItems = new List<SolutionItem> ();
			foreach (SolutionItem it in sol.GetAllItems<SolutionItem> ()) {
				// Include in the list if it can run in any of the existing execution modes and configurations
				foreach (IExecutionModeSet mset in Runtime.ProcessService.GetExecutionModes ()) {
					bool matched = false;
					foreach (IExecutionMode mode in mset.ExecutionModes) {
						foreach (SolutionConfiguration sc in sol.Configurations) {
							if (it.CanExecute (new ExecutionContext (mode, null, IdeApp.Workspace.ActiveExecutionTarget), sc.Selector)) {
								startupItems.Add (it);
								matched = true;
								break;
							}
						}
						if (matched)
							break;
					}
					if (matched)
						break;
				}
			}
			
			listStore = new ListStore (typeof(SolutionFolderItem), typeof(bool), typeof(string));
			treeItems.Model = listStore;
			treeItems.SearchColumn = -1; // disable the interactive search

			CellRendererToggle crt = new CellRendererToggle ();
			treeItems.AppendColumn ("", crt, "active", 1);
			treeItems.AppendColumn (GettextCatalog.GetString ("Project"), new CellRendererText (), "text", 2);
			
			if (startupItems.Count > 0) {
				for (int n=0; n<startupItems.Count; n++) {
					SolutionItem it = startupItems [n];
					comboItems.AppendText (it.Name);
					listStore.AppendValues (it, sol.MultiStartupItems.Contains (it), it.Name);
					if (sol.StartupItem == it)
						comboItems.Active = n;
				}
			}
			else {
				comboItems.AppendText (GettextCatalog.GetString ("The solution does not contain any executable project"));
				comboItems.Active = 0;
				comboItems.Sensitive = false;
				radioMulti.Sensitive = false;
				radioSingle.Sensitive = false;
			}
			
			radioSingle.Active = sol.SingleStartup;
			radioMulti.Active = !sol.SingleStartup;
			UpdateButtons ();
			
			crt.Toggled += OnItemToggled;
			treeItems.Selection.Changed += OnSelectionChanged;
		}
开发者ID:sushihangover,项目名称:monodevelop,代码行数:58,代码来源:StartupOptionsPanel.cs

示例2: ConfigurationEquals

		bool ConfigurationEquals (Solution sol, SolutionConfiguration s1, SolutionConfiguration s2)
		{
			foreach (var p in sol.GetAllItems<SolutionItem> ()) {
				var c1 = s1.GetEntryForItem (p);
				var c2 = s2.GetEntryForItem (p);
				if (c1 == null && c2 == null)
					continue;
				if (c1 == null || c2 == null)
					return false;
				if (c1.Build != c2.Build || c1.ItemConfiguration != c2.ItemConfiguration)
					return false;
			}
			return true;
		}
开发者ID:kdubau,项目名称:monodevelop,代码行数:14,代码来源:ConfigurationMerger.cs

示例3: WriteFileInternal

		internal void WriteFileInternal (SlnFile sln, Solution solution, ProgressMonitor monitor)
		{
			SolutionFolder c = solution.RootFolder;

			// Delete data for projects that have been removed from the solution

			var currentProjects = new HashSet<string> (solution.GetAllItems<SolutionFolderItem> ().Select (it => it.ItemId));
			var removedProjects = new HashSet<string> ();
			if (solution.LoadedProjects != null)
				removedProjects.UnionWith (solution.LoadedProjects.Except (currentProjects));
			var unknownProjects = new HashSet<string> (sln.Projects.Select (p => p.Id).Except (removedProjects).Except (currentProjects));

			foreach (var p in removedProjects) {
				var ps = sln.Projects.GetProject (p);
				if (ps != null)
					sln.Projects.Remove (ps);
				var pc = sln.ProjectConfigurationsSection.GetPropertySet (p, true);
				if (pc != null)
					sln.ProjectConfigurationsSection.Remove (pc);
			}
			var secNested = sln.Sections.GetSection ("NestedProjects");
			if (secNested != null) {
				foreach (var np in secNested.Properties.ToArray ()) {
					if (removedProjects.Contains (np.Key) || removedProjects.Contains (np.Value))
						secNested.Properties.Remove (np.Key);
				}
			}
			solution.LoadedProjects = currentProjects;

			//Write the projects
			using (monitor.BeginTask (GettextCatalog.GetString ("Saving projects"), 1)) {
				monitor.BeginStep ();
				WriteProjects (c, sln, monitor, unknownProjects);
			}

			//FIXME: SolutionConfigurations?

			var pset = sln.SolutionConfigurationsSection;
			foreach (SolutionConfiguration config in solution.Configurations) {
				var cid = ToSlnConfigurationId (config);
				pset.SetValue (cid, cid);
			}

			WriteProjectConfigurations (solution, sln);

			//Write Nested Projects
			ICollection<SolutionFolder> folders = solution.RootFolder.GetAllItems<SolutionFolder> ().ToList ();
			if (folders.Count > 1) {
				// If folders ==1, that's the root folder
				var sec = sln.Sections.GetOrCreateSection ("NestedProjects", SlnSectionType.PreProcess);
				foreach (SolutionFolder folder in folders) {
					if (folder.IsRoot)
						continue;
					WriteNestedProjects (folder, solution.RootFolder, sec);
				}
				// Remove items which don't have a parent folder
				var toRemove = solution.GetAllItems<SolutionFolderItem> ().Where (it => it.ParentFolder == solution.RootFolder);
				foreach (var it in toRemove)
					sec.Properties.Remove (it.ItemId);
			}

			// Write custom properties for configurations
			foreach (SolutionConfiguration conf in solution.Configurations) {
				string secId = "MonoDevelopProperties." + conf.Id;
				var sec = sln.Sections.GetOrCreateSection (secId, SlnSectionType.PreProcess);
				solution.WriteConfigurationData (monitor, sec.Properties, conf);
				if (sec.IsEmpty)
					sln.Sections.Remove (sec);
			}
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:70,代码来源:SlnFileFormat.cs


注:本文中的Solution.GetAllItems方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。