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;
}