MonoDevelop.Projects.Formats.MSBuild.MSBuildProject.GetAllItems C# (CSharp) Method

GetAllItems() public method

public GetAllItems ( ) : IEnumerable
return IEnumerable
		public IEnumerable<MSBuildItem> GetAllItems ()
		{
			foreach (XmlElement elem in doc.DocumentElement.SelectNodes ("tns:ItemGroup/*", XmlNamespaceManager)) {
				yield return GetItem (elem);
			}
		}
		

Usage Example

		public bool Migrate (IProjectLoadProgressMonitor monitor, MSBuildProject project, string fileName, string language)
		{
			// Migrate 'Page' build action to 'InterfaceDefinition' (see Bug 147 - XIB files need Build Action other than Page)
			// NOTE: Work around mono bug by calling ToList() before iterating: http://bugzilla.xamarin.com/show_bug.cgi?id=520
			foreach (var item in project.GetAllItems ().Where (item => item.Name == "Page").ToList ()) {
				var newElement = project.doc.CreateElement (BuildAction.InterfaceDefinition);
				newElement.InnerXml = item.Element.InnerXml;
				foreach (System.Xml.XmlAttribute attribute in item.Element.Attributes)
					newElement.SetAttribute (attribute.Name, attribute.Value);
				item.Element.ParentNode.ReplaceChild (newElement, item.Element);
			}
			
			return true;
		}
All Usage Examples Of MonoDevelop.Projects.Formats.MSBuild.MSBuildProject::GetAllItems