void LoadContents(IEnumerable <XElement> elements) { foreach (var element in elements) { string key = (string)element.Attribute("key"); if (key == null) { continue; } switch (element.Name.LocalName) { case "Property": dict[key] = element.Value; break; case "Array": dict[key] = LoadArray(element.Elements()); break; case "SerializedObject": dict[key] = new XElement(element); break; case "Properties": Properties child = new Properties(this); child.LoadContents(element.Elements()); dict[key] = child; break; } } }
public static Properties Load(XElement element) { Properties properties = new Properties(); properties.LoadContents(element.Elements()); return(properties); }