示例#1
0
        static void MainX()
        {
            string result = RunProfile.Execute("2014 Proleague Overall.xml");

            LiquipediaClientEx lpc = new LiquipediaClientEx();

            lpc.Login("", "");
            string token = lpc.GetEditToken();

            lpc.EditPage("User:Xpaperclip/Carno/Proleague", result, "test", token);
            return;

            DataStore data = new DataStore();

            DataStore.LoadRewriter("playerpka.dict", data.IdRewriter);
            DataStore.LoadRewriter("mapakas.dict", data.MapRewriter);

            data.Accumulate("http://wiki.teamliquid.net/starcraft2/2013_Global_StarCraft_II_Team_League_Season_2/Round_1");

            PageGenerator pagegen = PageGenerator.FromXml(System.Xml.Linq.XDocument.Load("pages/Team League (All-Kill Format).xml"));
            string        emit    = pagegen.Emit(data);

            // push update

            UI.ShowDialog(new UIDocument("emit", emit),
                          new UIDocument("html", LiquipediaClientEx.RequestParse(emit)),
                          new UIDocument("xml", pagegen.Save().ToString()));
        }
示例#2
0
        private void btnRun_Click(object sender, EventArgs e)
        {
            DataStore data = new DataStore();

            DataStore.LoadRewriter("playerpka.dict", data.IdRewriter);
            DataStore.LoadRewriter("mapakas.dict", data.MapRewriter);

            foreach (ListViewItem item in lvwList.CheckedItems)
            {
                try
                {
                    data.Accumulate(item.Text);
                    item.ForeColor = Color.Green;
                }
                catch (Exception ex)
                {
                    // just swallow errors for now
                    item.ForeColor = Color.Red;
                }
                Application.DoEvents();
            }

            PageGenerator pagegen = PageGenerator.FromXml(System.Xml.Linq.XDocument.Load("pages/" + cmbPageLayouts.SelectedItem + ".xml"));
            string        result  = pagegen.Emit(data);

            UI.ShowDialog(new UIDocument("Statistics", result));

            foreach (ListViewItem item in lvwList.CheckedItems)
            {
                item.ForeColor = lvwList.ForeColor;
            }
        }