コード例 #1
0
        public void TestMultySection()
        {
            KopsTournament t = new KopsTournament("1.INF", new MultySectionReader());
              t.ReadResults();

              Assert.AreEqual(MultySectionResources.PrintResults, t.PrintResults());
              Assert.AreEqual(MultySectionResources.PrintProtocols, t.PrintProtocols());
              Assert.AreEqual(MultySectionResources.PrintAllHistories, t.PrintAllHistories());
              List<int> players = new List<int>() { 1, 3, 15 };
              Assert.AreEqual(MultySectionResources.PrintListHistories, t.PrintListHistories(players));
        }
コード例 #2
0
        public void TestMultySection()
        {
            KopsTournament t = new KopsTournament("1.INF", new MultySectionReader());

            t.ReadResults();

            Assert.AreEqual(MultySectionResources.PrintResults, t.PrintResults());
            Assert.AreEqual(MultySectionResources.PrintProtocols, t.PrintProtocols());
            Assert.AreEqual(MultySectionResources.PrintAllHistories, t.PrintAllHistories());
            List <int> players = new List <int>()
            {
                1, 3, 15
            };

            Assert.AreEqual(MultySectionResources.PrintListHistories, t.PrintListHistories(players));
        }
コード例 #3
0
ファイル: fMain.cs プロジェクト: Jauhen/BMtoKoPS
        private void openPairTournamentToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (openPairTournament.ShowDialog() == DialogResult.OK)
            {
                string[] str = openPairTournament.FileNames;

                if (str.Length > 0)
                {
             /*       bwsfile = String.Format(@"{0}\{1}.bws", Path.GetDirectoryName(str[0]), Path.GetFileNameWithoutExtension(str[0]));
                    BwsHelper bws = new BwsHelper(bwsfile);

                    fBMSettings form = new fBMSettings(false);
                    if (form.ShowDialog() == DialogResult.OK)
                    {
                        bws.SetSettings(form.options);
                    }

                    if (str.Length > 1)
                    {
                        Dictionary<string,object> split = new Dictionary<string,object>();
                        split.Add("GroupSections", false);
                        bws.SetSettings(split);
                    }
            */
                    tournaments = new List<KopsTournament>();

                    foreach (string s in str)
                    {
                        KopsTournament t = new KopsTournament(s, new KopsReader());
                        tournaments.Add(t);
                        /* add new tab for tournament */
                        TabPage tp = new TabPage(Path.GetFileNameWithoutExtension(s));
                        tabControl1.TabPages.Add(tp);
                        SessionPrintouts control = new SessionPrintouts(t);
                        control.Parent = tp;
                        control.Dock = DockStyle.Fill;
                    }
                }
                if (tournaments.Count > 0)
                {
                    //filling grid width tournament data
             /*           BindingSource bSource = new BindingSource();
                    bSource.DataSource = tournaments[0].results.Tables["Fill"];
                    dataGridTourn1.DataSource = bSource;
                    dataGridTourn1.Width = (dataGridTourn1.ColumnCount) * 23 + 1;
                    dataGridTourn1.Height = (dataGridTourn1.RowCount) * 20 + 2;

                    for(int i = 0 ; i < dataGridTourn1.RowCount; i++) {
                        dataGridTourn1.Rows[i].Cells[0].Style.BackColor = Color.Blue;
                        dataGridTourn1.Rows[i].Cells[0].Style.ForeColor = Color.White;
                    }
                    for (int i = 0; i < dataGridTourn1.ColumnCount; i++)
                    {
                        dataGridTourn1.Rows[0].Cells[i].Style.BackColor = Color.Blue;
                        dataGridTourn1.Rows[0].Cells[i].Style.ForeColor = Color.White;
                    }
            */

                }
            }
        }
コード例 #4
0
        private void openPairTournamentToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (openPairTournament.ShowDialog() == DialogResult.OK)
            {
                string[] str = openPairTournament.FileNames;

                if (str.Length > 0)
                {
                    /*       bwsfile = String.Format(@"{0}\{1}.bws", Path.GetDirectoryName(str[0]), Path.GetFileNameWithoutExtension(str[0]));
                     *     BwsHelper bws = new BwsHelper(bwsfile);
                     *
                     *     fBMSettings form = new fBMSettings(false);
                     *     if (form.ShowDialog() == DialogResult.OK)
                     *     {
                     *         bws.SetSettings(form.options);
                     *     }
                     *
                     *     if (str.Length > 1)
                     *     {
                     *         Dictionary<string,object> split = new Dictionary<string,object>();
                     *         split.Add("GroupSections", false);
                     *         bws.SetSettings(split);
                     *     }
                     */
                    tournaments = new List <KopsTournament>();

                    foreach (string s in str)
                    {
                        KopsTournament t = new KopsTournament(s, new KopsReader());
                        tournaments.Add(t);
                        /* add new tab for tournament */
                        TabPage tp = new TabPage(Path.GetFileNameWithoutExtension(s));
                        tabControl1.TabPages.Add(tp);
                        SessionPrintouts control = new SessionPrintouts(t);
                        control.Parent = tp;
                        control.Dock   = DockStyle.Fill;
                    }
                }
                if (tournaments.Count > 0)
                {
                    //filling grid width tournament data

                    /*           BindingSource bSource = new BindingSource();
                     *         bSource.DataSource = tournaments[0].results.Tables["Fill"];
                     *         dataGridTourn1.DataSource = bSource;
                     *         dataGridTourn1.Width = (dataGridTourn1.ColumnCount) * 23 + 1;
                     *         dataGridTourn1.Height = (dataGridTourn1.RowCount) * 20 + 2;
                     *
                     *         for(int i = 0 ; i < dataGridTourn1.RowCount; i++) {
                     *             dataGridTourn1.Rows[i].Cells[0].Style.BackColor = Color.Blue;
                     *             dataGridTourn1.Rows[i].Cells[0].Style.ForeColor = Color.White;
                     *         }
                     *         for (int i = 0; i < dataGridTourn1.ColumnCount; i++)
                     *         {
                     *             dataGridTourn1.Rows[0].Cells[i].Style.BackColor = Color.Blue;
                     *             dataGridTourn1.Rows[0].Cells[i].Style.ForeColor = Color.White;
                     *         }
                     */
                }
            }
        }