public override void Export(Asset asset, string path)
        {
            var model = (asset as Model);
            if (string.Compare(Path.GetFileName(path), "structure.xml", true) != 0) { path += "\\Structure.xml"; }

            if (model.SupportingDocuments.ContainsKey("Structure"))
            {
                ((Structure)model.SupportingDocuments["Structure"]).Save(path);
            }
            else
            {
                var structure = new Structure();

                var root = new StructurePart() { IsRoot = true };

                TravelTree(model.Root, ref root, true);

                structure.Root = root;

                structure.Save(path);
            }
        }
Пример #2
0
        public static Structure Load(string path)
        {
            Structure structure = new Structure();

            using (var xml = new XMLParser(path, "STRUCTURE"))
            {
                structure.characteristics = StructureCharacteristicsCode.Parse(xml.GetNode("CHARACTERISTICS").FirstChild.InnerText);
                structure.root = new StructurePart(xml.GetNode("ROOT"));
            }

            return structure;
        }