Ejemplo n.º 1
0
        public static List <CActDef> ReadActionDef(string pFileName)
        {
            List <CActDef> result;

            if (pFileName.Length > 0)
            {
                XmlTextReader xmlTextReader = new XmlTextReader(pFileName);
                try
                {
                    result = CActDefs.XML2ActionDefs(xmlTextReader);
                }
                catch
                {
                    result = new List <CActDef>();
                }
                if (xmlTextReader != null)
                {
                    xmlTextReader.Close();
                }
            }
            else
            {
                result = new List <CActDef>();
            }
            return(result);
        }
Ejemplo n.º 2
0
        public static List <Vector3> ReadTargets(string pTargetStr)
        {
            List <Vector3>      result              = new List <Vector3>();
            NameTable           nameTable           = new NameTable();
            XmlNamespaceManager xmlNamespaceManager = new XmlNamespaceManager(nameTable);

            xmlNamespaceManager.AddNamespace("bk", "urn:sample");
            XmlParserContext context       = new XmlParserContext(null, xmlNamespaceManager, null, XmlSpace.None);
            XmlTextReader    xmlTextReader = new XmlTextReader(pTargetStr, XmlNodeType.Element, context);

            try
            {
                result = CActDefs.XML2Targets(xmlTextReader);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            if (xmlTextReader != null)
            {
                xmlTextReader.Close();
            }
            return(result);
        }