コード例 #1
0
        public void run()
        {
            if (!File.Exists(xml_full))
            {
                throw new DMTException("[ERROR] Joonise kaustas ei ole XML faili nimega: " + name + ".xml");
            }
            if (File.Exists(xml_lock_full))
            {
                throw new DMTLockedException("[ERROR] XML fail nimega: " + name + ".xml" + " on lukkus!");
            }


            File.Create(xml_lock_full).Dispose();
            write("[XML] LOCK ON");

            XmlDocument xmlDoc = new XmlDocument();

            xmlDoc.Load(xml_full);
            xmlDoc = XML_Handle.removeEmptyNodes(xmlDoc);

            List <XmlNode> pages  = XML_Handle.getAllPages(xmlDoc);
            List <XmlNode> rebars = XML_Handle.getAllRebar(xmlDoc);

            if (rebars.Count > 0)
            {
                filtreeri(pages, rebars, xmlDoc);
                xmlDoc.Save(xml_output_full);
            }
        }
コード例 #2
0
        public void run()
        {
            if (!File.Exists(xml_full))
            {
                throw new DMTException("[ERROR] Joonise kaustas ei ole XML faili nimega: " + name + ".xml");
            }
            if (File.Exists(xml_lock_full))
            {
                throw new DMTLockedException("[ERROR] XML fail nimega: " + name + ".xml" + " on lukkus!");
            }


            File.Create(xml_lock_full).Dispose();
            write("[XML] LOCK ON");

            XmlDocument xmlDoc = new XmlDocument();

            xmlDoc.Load(xml_full);
            xmlDoc = XML_Handle.removeEmptyNodes(xmlDoc);

            List <_Mark> marks         = getSelectedMarks();
            List <_Mark> filteredMarks = filterSelectedMarks(marks);

            List <XmlNode> pages  = XML_Handle.getAllPages(xmlDoc);
            List <XmlNode> rebars = XML_Handle.getAllRebar(xmlDoc);

            Dictionary <_Mark, XmlNode> warning = new Dictionary <_Mark, XmlNode>();
            List <_Mark> undefined = findMarksInXML(rebars, filteredMarks, ref warning);

            if (undefined.Count != 0)
            {
                List <XmlNode> newRebars = handleUndefined(undefined, rebars, xmlDoc);
                rebars.AddRange(newRebars);
                filtreeri(pages, rebars, xmlDoc);
                xmlDoc.Save(xml_output_full);
            }

            foreach (_Mark m in warning.Keys)
            {
                write("--- WARINING: " + m.ToString());
                string rebarString = XML_Handle.getXMLRebarString(warning[m]);
                write("--- WARINING: " + rebarString);
                write("");
            }
        }