示例#1
0
        public void categorySearch()
        {
            doc = new XmlDocument();
            XmlReader reader = XmlReader.Create("SearchCategory.xml");

            while (reader.Read())
            {
                if (reader.IsStartElement("Search"))
                {
                    FCId.makeFcidlist(reader, fcidlist);
                }
            }
            reader.Close();
        }
示例#2
0
        static internal void makeFcidlist(XmlReader xr, List <FCId> fcidlist)
        {
            string keyword = string.Empty;


            //bool isLast = true;
            for (int i = 100; i < 130; i++)
            {
                string str = "C" + i.ToString();

                if (i == 100)
                {
                    xr.ReadToDescendant(str);
                }
                else if (i == 106)
                {
                    str = "C" + (i + 1).ToString();
                    xr.ReadToNextSibling(str);
                    i++;
                }
                else if (i == 121)
                {
                    str = "C" + (i + 1).ToString();
                    xr.ReadToNextSibling(str);
                    i++;
                }
                else if (i == 127)
                {
                    str = "C" + (i + 1).ToString();
                    xr.ReadToNextSibling(str);
                    i++;
                }
                else
                {
                    xr.ReadToNextSibling(str);
                }
                keyword = xr.ReadElementContentAsString();
                FCId fcid = new FCId(int.Parse(keyword));
                fcidlist.Add(fcid);
            }
            for (int i = 200; i < 219; i++)
            {
                string str = "C" + i.ToString();

                if (i == 200)
                {
                    xr.ReadToNextSibling(str);
                }
                else
                {
                    xr.ReadToNextSibling(str);
                }
                keyword = xr.ReadElementContentAsString();
                if (i == 219)
                {
                    break;
                }
                FCId fcid = new FCId(int.Parse(keyword));
                fcidlist.Add(fcid);
            }
        }