private static SlabImageFile[] LoadSlabBindingImageFiles(XmlNode node) { if (node.LocalName != "images") { throw new SlabManifestFormatException(string.Format("images node expected. Found {0}", node.LocalName)); } SlabImageFile[] array = new SlabImageFile[node.ChildNodes.Count]; for (int i = 0; i < node.ChildNodes.Count; i++) { string attributeValue = SlabManifestLoader.GetAttributeValue(node.ChildNodes[i], "name"); string attributeValue2 = SlabManifestLoader.GetAttributeValue(node.ChildNodes[i], "layout"); string attributeValue3 = SlabManifestLoader.GetAttributeValue(node.ChildNodes[i], "type"); if (string.IsNullOrEmpty(attributeValue3)) { throw new SlabManifestFormatException(string.Format("image node requires a type attribute", new object[0])); } if (attributeValue != null) { array[i] = new SlabImageFile { Name = attributeValue, Type = attributeValue3, Layout = SlabManifestLoader.GetResourceLayout(attributeValue2) }; } } return(array); }
private static SlabConfiguration[] LoadSlabBindingConfigurations(XmlNode node) { if (node.LocalName != "configurations") { throw new SlabManifestFormatException(string.Format("configurations node expected. Found {0}", node.LocalName)); } SlabConfiguration[] array = new SlabConfiguration[node.ChildNodes.Count]; for (int i = 0; i < node.ChildNodes.Count; i++) { string attributeValue = SlabManifestLoader.GetAttributeValue(node.ChildNodes[i], "type"); string attributeValue2 = SlabManifestLoader.GetAttributeValue(node.ChildNodes[i], "layout"); array[i] = new SlabConfiguration { Type = attributeValue, Layout = SlabManifestLoader.GetResourceLayout(attributeValue2) }; } return(array); }
private static SlabStyleFile[] LoadSlabStyleFiles(XmlNode node) { if (node.LocalName != "styles" && node.LocalName != "packagedStyles") { throw new SlabManifestFormatException(string.Format("styles node expected. Found {0}", node.LocalName)); } SlabStyleFile[] array = new SlabStyleFile[node.ChildNodes.Count]; for (int i = 0; i < node.ChildNodes.Count; i++) { string attributeValue = SlabManifestLoader.GetAttributeValue(node.ChildNodes[i], "layout"); string attributeValue2 = SlabManifestLoader.GetAttributeValue(node.ChildNodes[i], "type"); array[i] = new SlabStyleFile { Name = SlabManifestLoader.GetAttributeValue(node.ChildNodes[i], "name"), Layout = SlabManifestLoader.GetResourceLayout(attributeValue), Type = attributeValue2 }; } return(array); }
private static SlabFontFile[] LoadSlabBindingFontFiles(XmlNode node) { if (node.LocalName != "fonts") { throw new SlabManifestFormatException(string.Format("fonts node expected. Found {0}", node.LocalName)); } SlabFontFile[] array = new SlabFontFile[node.ChildNodes.Count]; for (int i = 0; i < node.ChildNodes.Count; i++) { string attributeValue = SlabManifestLoader.GetAttributeValue(node.ChildNodes[i], "name"); string attributeValue2 = SlabManifestLoader.GetAttributeValue(node.ChildNodes[i], "layout"); if (attributeValue != null) { array[i] = new SlabFontFile { Name = attributeValue, Layout = SlabManifestLoader.GetResourceLayout(attributeValue2) }; } } return(array); }