Esempio n. 1
0
        private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
        {
            XmlDocument doc = new XmlDocument();
            if (File.Exists(Application.StartupPath + "\\scholarbowl.dat")) {
                File.Move(Application.StartupPath + "\\scholarbowl.dat",
                    Application.StartupPath + "\\Statistics.xml");
            }
            if (File.Exists(Application.StartupPath + "\\Statistics.xml")) {
                doc.Load(Application.StartupPath + "\\Statistics.xml");
            }
            else {
                doc.LoadXml("<scholarbowl><schools></schools><scholars></scholars><matches></matches></scholarbowl>");
            }
            Schools = School.FromXmlNode(doc);
            Players = Player.FromXmlNode(doc, Schools);
            AllMatches = MatchList.FromXml(doc, Schools, Players);

            PlayerControlList listView1 = new PlayerControlList(groupBox1);
            PlayerControlList listView2 = new PlayerControlList(groupBox2);

            BeginInvoke(new MethodInvoker(delegate
            {
                playerList1 = listView1;
                playerList2 = listView2;
                reload();
            }));
        }
Esempio n. 2
0
        private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
        {
            XmlDocument doc = new XmlDocument();

            if (File.Exists(Application.StartupPath + "\\scholarbowl.dat"))
            {
                File.Move(Application.StartupPath + "\\scholarbowl.dat",
                          Application.StartupPath + "\\Statistics.xml");
            }
            if (File.Exists(Application.StartupPath + "\\Statistics.xml"))
            {
                doc.Load(Application.StartupPath + "\\Statistics.xml");
            }
            else
            {
                doc.LoadXml("<scholarbowl><schools></schools><scholars></scholars><matches></matches></scholarbowl>");
            }
            Schools    = School.FromXmlNode(doc);
            Players    = Player.FromXmlNode(doc, Schools);
            AllMatches = MatchList.FromXml(doc, Schools, Players);

            PlayerControlList listView1 = new PlayerControlList(groupBox1);
            PlayerControlList listView2 = new PlayerControlList(groupBox2);

            BeginInvoke(new MethodInvoker(delegate
            {
                playerList1 = listView1;
                playerList2 = listView2;
                reload();
            }));
        }