Пример #1
0
 public SMEXMLReader(SMEProjectInformation proinfo,
                     SMESystemInformation sysinfo,
                     SMEExceptionInformation exinfo,
                     SMECallstackInformation callstackinfo)
 {
     m_xmldocument = new XDocument();
     m_rootElement = new XElement("SME");
     m_xmldocument.Add(m_rootElement);
     m_rootElement.Add(proinfo.ToXElement());
     m_rootElement.Add(sysinfo.ToXElement());
     m_rootElement.Add(exinfo.ToXElement());
     m_rootElement.Add(callstackinfo.ToXElement());
 }
Пример #2
0
        public void LoadFromXML(string path)
        {
            m_xmldocument = XDocument.Load(path);
            m_rootElement = (XElement)m_xmldocument.FirstNode;
            if(m_rootElement.Name.ToString().Equals("SME"))
            {
                XElement el = (XElement)m_rootElement.FirstNode;
                ProjectInfo = new SMEProjectInformation(el);
                el = (XElement)el.NextNode;
                SystemInfo = new SMESystemInformation(el);
                el = (XElement)el.NextNode;
                ExceptionInfo = new SMEExceptionInformation(el);
                el = (XElement)el.NextNode;
                CallStackInfo = new SMECallstackInformation(el);

            }
            else
            {
                throw new Exception("SME XML 파일이 아닙니다.");
            }
        }