Example #1
0
        public static YbnFile GetYbn(XmlDocument doc)
        {
            YbnFile r = new YbnFile();

            var node  = doc.DocumentElement;
            var bnode = node?.SelectSingleNode("Bounds");

            if (bnode != null)
            {
                r.Bounds = Bounds.ReadXmlNode(bnode, r);
            }

            return(r);
        }
Example #2
0
        public static string GetXml(YbnFile ybn)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendLine(XmlHeader);

            var name = "BoundsFile";

            OpenTag(sb, 0, name);

            if (ybn?.Bounds != null)
            {
                Bounds.WriteXmlNode(ybn.Bounds, sb, 1);
            }

            CloseTag(sb, 0, name);

            return(sb.ToString());
        }