Beispiel #1
0
        public void select()
        {
            myEvent ev1 = new myEvent();

            ev1.info += new Print(InfoHandler);
            XmlDocument Doc = new XmlDocument();

            Doc.Load("card.xml");
            delete();
            XmlElement  cRoot  = Doc.DocumentElement;
            XmlNodeList cNodes = cRoot.SelectNodes("card");

            foreach (XmlNode n in cNodes)
            {
                this.criterion = n.SelectSingleNode("@fio").Value;
                this.count     = 0;
                XmlNodeList nNodes = n.SelectNodes("book");
                foreach (XmlNode i in nNodes)
                {
                    this.count += 1;
                }
                add();
            }
            ev1.myWrite();
        }
Beispiel #2
0
        public static void Test()
        {
            myEvent ev1 = new myEvent();

            ev1.info += new Print(MyEventHandler);
            ev1.myWrite();
        }
Beispiel #3
0
        public void select()
        {
            myEvent ev1 = new myEvent();

            ev1.info += new Print(InfoHandler);
            XmlDocument Doc1 = new XmlDocument();

            Doc1.Load("card.xml");
            delete();
            bool        f      = true;
            XmlElement  cRoot  = Doc1.DocumentElement;
            XmlNodeList cNodes = cRoot.SelectNodes("card");

            foreach (XmlNode n in cNodes)
            {
                XmlNodeList nNodes = n.SelectNodes("book");
                foreach (XmlNode h in nNodes)
                {
                    string crit = h.SelectSingleNode("@name").Value;
                    if (f)
                    {
                        this.criterion = crit;
                        this.count     = 1;
                        add();
                        f = false;
                    }
                    else
                    {
                        if (!search(crit))
                        {
                            this.criterion = crit;
                            this.count     = 1;
                            add();
                            f = false;
                        }
                    }
                }
            }
            ev1.myWrite();
        }