public KLTag getTagByID(string ID) { KLTag tag = new KLTag(); foreach(KLTag t in this.tags) { if (t.getID().Equals(ID,StringComparison.InvariantCultureIgnoreCase)) { tag = t; break; } } return tag; }
private void readTagsBase() { XDocument doc = XDocument.Load(path); foreach (XElement tagEl in doc.Root.Elements()) { KLTag tag = new KLTag(); foreach(XElement el in tagEl.Elements()) { if (el.Name == "id") tag.setID(el.Value); else if (el.Name == "name_ua") tag.setNameUA(el.Value); else if (el.Name == "name_ru") tag.setNameRU(el.Value); else if (el.Name == "color") tag.setColor(el.Value); } tags.Add(tag); } }
public void addTag(KLTag tag) { this.tags.Add(tag); }