public static SpaceItem InvokeCreate(string typ) { SpaceItem si = StructXml.CreateInstanceFromType(typ) as SpaceItem; if (si == null) { return(new SpaceItem()); } else { return(si); } }
public void FromXml(XmlNode node) { this.name = node.Attributes["Name"].Value; SpaceItem sit; bodies.Clear(); foreach (XmlNode xSit in node.ChildNodes) { sit = SpaceItem.InvokeCreate(xSit.Attributes["Type"].Value); sit.FromXml(xSit); bodies.Add(xSit.Name, sit); } }