示例#1
0
文件: node.cs 项目: zainGohar/osm2shp
        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);
                    }
				        }
				      
		        }
      }
示例#2
0
 public void Remove(tag item)
 {
     _list.Remove(item);
 }
示例#3
0
 public void Add(tag item)
 {
     _list.Add(item);
 }
示例#4
0
        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);
                    }
                }
            }
        }
示例#5
0
文件: tag.cs 项目: zainGohar/osm2shp
		    public void Remove(tag item)
		    {
			      _list.Remove(item);
		    }
示例#6
0
文件: tag.cs 项目: zainGohar/osm2shp
		    public void Add(tag item)
		    {
			      _list.Add(item);
		    }