예제 #1
0
 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);
             });
         }
     });
 }
예제 #2
0
        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);
        }
예제 #3
0
 public CodeListEntry(CodeLists theIndex, string theName)
 {
     this.index = theIndex;
     this.name  = theName;
 }