public IList <ListItem> GetListItems() { XmlDocument doc = GetXmlDocumentByFileName(DbListItemFile); IList <ListItem> list = new List <ListItem>(); XmlNodeList nodeList = doc.GetElementsByTagName("Lists"); if (nodeList.Count > 0) { XmlNode root = nodeList[0]; foreach (XmlNode node in root.ChildNodes) { list.Add(ListItem.LoadByXmlNode(node)); } } return(list); }
public ListItem GetListItemById(string id) { XmlDocument doc = GetXmlDocumentByFileName(DbListItemFile); IList <ListItem> list = new List <ListItem>(); XmlNodeList nodeList = doc.GetElementsByTagName("Lists"); if (nodeList.Count > 0) { XmlNode root = nodeList[0]; foreach (XmlNode node in root.ChildNodes) { ListItem item = ListItem.LoadByXmlNode(node); if (item.Id.Equals(id, StringComparison.OrdinalIgnoreCase)) { return(item); } } } return(null); }