Beispiel #1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            frmTeamAdd add = new frmTeamAdd();

            if (add.ShowDialog() == DialogResult.Cancel)
            {
                return;
            }

            EpTeam t = new EpTeam();

            t.TeamName = add.TeamName;
            team.Add(t);
            cmbTeam.Items.Add(t.TeamName);
        }
Beispiel #2
0
        private void btnOpen_Click(object sender, EventArgs e)
        {
            OpenFileDialog ofd = new OpenFileDialog();

            ofd.Filter = "Education Plus Team 파일(*.ept)|*.ept";
            if (ofd.ShowDialog() == DialogResult.Cancel)
            {
                return;
            }

            FileStream fs = new FileStream(ofd.FileName, FileMode.Open);

            BinaryReader b   = new BinaryReader(fs);
            int          len = b.ReadInt32();

            team.Clear();
            for (int i = 0; i < len; i++)
            {
                EpTeam temp = new EpTeam();
                temp.TeamName = b.ReadString();
                int tlen = b.ReadInt32();
                temp.SetData(b.ReadBytes(tlen));
                team.Add(temp);
            }

            b.Close();

            fs.Close();
            fs.Dispose();

            cmbTeam.Text   = "";
            numPoint.Value = 0;
            lstTeamMember.Items.Clear();
            SetEnable();

            foreach (EpTeam t in team)
            {
                cmbTeam.Items.Add(t.TeamName);
            }
        }