internal virtual void ReadXml(XmlElement xmlParent) { if ( xmlParent.Attributes != null ) { foreach ( XmlAttribute xmlAttribute in xmlParent.Attributes ) { switch ( xmlAttribute.Name ) { case "id" : _id = Convert.ToInt32(xmlAttribute.Value); break; case "timestamp" : _timestamp = Convert.ToDateTime(xmlAttribute.Value); break; case "visible" : _visible = xmlAttribute.Value; break; case "lat" : _lat = xmlAttribute.Value; break; case "lon" : _lon = xmlAttribute.Value; break; case "deleted" : _deleted = Convert.ToBoolean(xmlAttribute.Value); break; default: break; //throw new ApplicationException(this.GetType().Name + " - Unknown attribute : " + xmlAttribute.Name); } } } foreach ( XmlNode xmlNode in xmlParent.ChildNodes ) { if ( xmlNode.NodeType == XmlNodeType.Element ) { switch ( xmlNode.Name ) { case "tag" : tag itemtag = new tag(); itemtag.ReadXml(xmlNode as XmlElement); _tagCollection.Add(itemtag); break; default: break; //throw new ApplicationException(this.GetType().Name + " - Unknown element : " + xmlNode.Name); } } } }
public void Remove(tag item) { _list.Remove(item); }
public void Add(tag item) { _list.Add(item); }
internal virtual void ReadXml(XmlElement xmlParent) { if (xmlParent.Attributes != null) { foreach (XmlAttribute xmlAttribute in xmlParent.Attributes) { switch (xmlAttribute.Name) { case "id": _id = Convert.ToInt32(xmlAttribute.Value); break; case "timestamp": _timestamp = Convert.ToDateTime(xmlAttribute.Value); break; case "visible": _visible = xmlAttribute.Value; break; case "action": _action = xmlAttribute.Value; break; case "deleted": _deleted = Convert.ToBoolean(xmlAttribute.Value); break; default: break; //throw new ApplicationException(this.GetType().Name + " - Unknown attribute : " + xmlAttribute.Name); } } } foreach (XmlNode xmlNode in xmlParent.ChildNodes) { if (xmlNode.NodeType == XmlNodeType.Element) { switch (xmlNode.Name) { case "nd": nd itemnd = new nd(); itemnd.ReadXml(xmlNode as XmlElement); _ndCollection.Add(itemnd); break; case "tag": tag itemtag = new tag(); itemtag.ReadXml(xmlNode as XmlElement); _tagCollection.Add(itemtag); break; default: break; //throw new ApplicationException(this.GetType().Name + " - Unknown element : " + xmlNode.Name); } } } }