示例#1
0
 public KLSubway getSubwayByID(string ID)
 {
     KLSubway subway = new KLSubway();
     foreach(KLSubway sub in this.subwayBase)
     {
         if (sub.getID().Equals(ID,StringComparison.InvariantCultureIgnoreCase))
         {
             subway = sub;
             break;
         }
     }
     return subway;
 }
示例#2
0
 private void readFromAssets()
 {
     XDocument doc = XDocument.Load(path);
     foreach(XElement station in doc.Root.Elements())
     {
         KLSubway stop = new KLSubway();
         foreach(XElement elem in station.Elements())
         {
             if (elem.Name == "id") stop.setID(elem.Value); else
             if (elem.Name == "title_ua") stop.setName(elem.Value); else
             if (elem.Name == "color") stop.setColor(elem.Value);
         }
         this.subwayBase.Add(stop);
     }
 }
示例#3
0
 public void setSubway(KLSubway subway)
 {
     this.subway = subway;
 }