Beispiel #1
0
        public XElement Save(string path, GateInkCanvas gc, bool isParsable)
        {
            XElement root = new XElement("CircuitGroup");
            root.SetAttributeValue("Version", "1.2");

            XElement maincircuit = CreateCircuitXML(gc.CreateIC("", GateInkCanvas.SELECTED_GATES.ALL));
            maincircuit.SetAttributeValue("Name", null);

            TopologicalSort ts = new TopologicalSort();
            List<UIGates.IC> ics = ts.Sort(icl, icl);

            foreach (UIGates.IC theic in ics)
            {
                root.Add(CreateCircuitXML(theic));
            }
            
            root.Add(maincircuit);

            root.Save(path);

            return root;
        }
Beispiel #2
0
        /// <summary>
        /// Create an XML representation of this IC and all nested ICs, recursively.
        /// </summary>
        /// <param name="ic"></param>
        /// <returns></returns>
        public XElement CreateXML(UIGates.IC ic)
        {
            XElement root = new XElement("CircuitGroup");
            root.SetAttributeValue("Version", "1.2");

            TopologicalSort ts = new TopologicalSort();
            List<UIGates.IC> ics = ts.Sort(ic, icl);

            foreach (UIGates.IC theic in ics)
            {
                root.Add(CreateCircuitXML(theic));
            }
            return root;
        }