Exemple #1
0
        public EngineNS.IO.XmlNode FindAndAddAssetNode(EngineNS.IO.XmlNode node, string name)
        {
            List <EngineNS.IO.XmlNode> nodes = node.GetNodes();

            foreach (var i in nodes)
            {
                //这里不能是空
                EngineNS.IO.XmlAttrib att = i.FindAttrib("Name");
                if (att != null && att.Value.Equals(name))
                {
                    return(i);
                }
            }

            EngineNS.IO.XmlNode sunnode = node.AddNode("Folder", "", AssetInfos);
            sunnode.AddAttrib("Name", name);

            return(sunnode);
        }
Exemple #2
0
        public List <XmlAttrib> GetAttribs()
        {
            unsafe
            {
                var attrList = new List <XmlAttrib>();

                if (CoreObject.Pointer == IntPtr.Zero)
                {
                    return(attrList);
                }

                for (var attr = XmlSDK.RapidXmlNodeA_first_attribute(CoreObject, null);
                     attr.Pointer != IntPtr.Zero;
                     attr = XmlSDK.RapidXmlAttribA_next_sibling(attr))
                {
                    var nd = new XmlAttrib(attr);
                    attrList.Add(nd);
                }

                return(attrList);
            }
        }
Exemple #3
0
 public void RemoveAttrib(XmlAttrib attr)
 {
     XmlSDK.RapidXmlNodeA_remove_attribute(CoreObject, attr.CoreObject);
 }