private void _loadCode(string name) { CodeLists.Clear(); Task.Factory.StartNew(() => { var list = XmlHelper.GetXmlNodeListByXpath(AppDomain.CurrentDomain.BaseDirectory + $"\\Codes\\{name}.xml", "/codes/code"); foreach (XmlNode item in list) { var code = new CodeItem(); foreach (XmlNode node in item.ChildNodes) { if (node.Name == "name") { code.Name = node.InnerText; } else if (node.Name == "description") { code.Descroption = node.InnerText; } else if (node.Name == "content") { code.Content = node.InnerText; } } Application.Current.Dispatcher.Invoke(() => { CodeLists.Add(code); }); } }); }
public IEnumerable <CodeList> FindCodeList(Id codeListId, Id agencyId, string version) { var result = CodeLists.Where(i => i.Id == codeListId && (agencyId == null || i.AgencyId == agencyId) && (version == null || i.Version == version)); return(result); }
public CodeListEntry(CodeLists theIndex, string theName) { this.index = theIndex; this.name = theName; }