Exemplo n.º 1
0
        public void LoadClass(string filePath)
        {
            var xmlDocData = new XmlDocument();

            xmlDocData.Load(filePath);
            foreach (XmlNode xmlNode in xmlDocData.FirstChild.ChildNodes)
            {
                Basic     basic = GenerateProcessManager.GetManager().Classes[xmlDocData.FirstChild.Name].BasicCreater();
                FieldInfo item  = basic.Parameters[xmlNode.Name];
                item.Data = item.DataConverter(xmlNode.InnerText);
                item.Run(ProcessResult);
            }
        }
Exemplo n.º 2
0
        public void CreatedXMLFile(string filePath)
        {
            XmlDocument finalDocument = new XmlDocument();

            finalDocument.LoadXml(xmlProperties.OuterXml);
            foreach (XmlNode xmlNode in xmlProperties.ChildNodes)
            {
                XmlNode innerNode = finalDocument.SelectSingleNode($"//{xmlNode.Name}");
                if (innerNode != null)
                {
                    innerNode.InnerText = Parameters[xmlNode.Name].Data.ToString();
                }
            }
            try
            {
                finalDocument.Save(filePath);;
            }
            catch (Exception e)
            {
                GenerateProcessManager.GetManager().SendStatus($"File {filePath} saving problem");
            }
        }