예제 #1
0
        public static SpaceItem InvokeCreate(string typ)
        {
            SpaceItem si = StructXml.CreateInstanceFromType(typ) as SpaceItem;

            if (si == null)
            {
                return(new SpaceItem());
            }
            else
            {
                return(si);
            }
        }
예제 #2
0
        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);
            }
        }