Exemplo n.º 1
0
        public XmlElement ToXml(XmlDocument ownerDoc)
        {
            XmlElement ele = ownerDoc.CreateElement("loc");

            ele.SetAttribute("id", Id.ToString());
            ele.SetAttribute("name", Name);
            ele.SetAttribute("type", Type.ToString());
            ele.SetAttribute("NS", Coords.NS.ToString());
            ele.SetAttribute("EW", Coords.EW.ToString());
            if (HasExitCoords)
            {
                ele.SetAttribute("exitNS", ExitCoords.NS.ToString());
                ele.SetAttribute("exitEW", ExitCoords.EW.ToString());
                if (!UseInRouteFinding)
                {
                    ele.SetAttribute("use", UseInRouteFinding.ToString());
                }
            }
            if (DungeonId != 0)
            {
                ele.SetAttribute("dungeonId", DungeonId.ToString());
            }
            if (IsCustomized)
            {
                ele.SetAttribute("customized", IsCustomized.ToString());
            }
            if (HasSpecializedIcon)
            {
                ele.SetAttribute("icon", GetIcon(false).ToString("X8"));
            }

            ele.InnerText = Notes;
            return(ele);
        }
 void IXmlSerializable.WriteXml(System.Xml.XmlWriter writer)
 {
     foreach (var member in new Dictionary <string, string>()
     {
         { "IsCustomized", IsCustomized.ToString() },
         { "BrowserName", BrowserName },
         { "ProfileName", ProfileName },
         { "CookiePath", CookiePath },
         { "EngineId", EngineId },
     })
     {
         writer.WriteStartElement(member.Key);
         writer.WriteString(member.Value);
         writer.WriteEndElement();
     }
 }