Beispiel #1
0
        public static XmlNode XmlAddPoint(XmlNode p_node, string node_name, Point p)
        {
            XmlNode node = Useful.XmlAddNode(p_node, node_name);

            Useful.XmlAddAttribute(node, "x", p.X.ToString());
            Useful.XmlAddAttribute(node, "y", p.Y.ToString());
            return(node);
        }
Beispiel #2
0
        public static XmlDocument XmlCreateXml(string root_name, string version)
        {
            if (string.IsNullOrEmpty(root_name))
            {
                return((XmlDocument)null);
            }
            XmlDocument xmlDocument = new XmlDocument();

            xmlDocument.AppendChild((XmlNode)xmlDocument.CreateXmlDeclaration("1.0", "UTF-8", (string)null));
            xmlDocument.AppendChild((XmlNode)xmlDocument.CreateElement(root_name));
            if (!string.IsNullOrEmpty(version))
            {
                Useful.XmlAddAttribute((XmlNode)xmlDocument.DocumentElement, "version", version);
            }
            return(xmlDocument);
        }
Beispiel #3
0
        public static XmlNode XmlAddNode(XmlNode p_node, string node_name, string name)
        {
            if (string.IsNullOrEmpty(name))
            {
                return((XmlNode)null);
            }
            name = name.Trim();
            if (string.IsNullOrEmpty(name))
            {
                return((XmlNode)null);
            }
            XmlNode node = Useful.XmlAddNode(p_node, node_name);

            Useful.XmlAddAttribute(node, "name", name);
            return(node);
        }