Ejemplo n.º 1
0
        private void btnAddJudge_Click(object sender, EventArgs e)
        {
            DialogSelectPerson dialogSelectPerson = new DialogSelectPerson();

            dialogSelectPerson.Title               = "Add Staff";
            dialogSelectPerson.AllowNewPlayers     = true;
            dialogSelectPerson.EnableStaffPosition = true;
            if (dialogSelectPerson.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            this.listStaff.Items.Add((object)new TournStaff(dialogSelectPerson.NewPlayer)
            {
                Position = dialogSelectPerson.SelectedStaffPosition
            });
        }
Ejemplo n.º 2
0
        private void btnEditJudge_Click(object sender, EventArgs e)
        {
            if (this.listStaff.SelectedIndex < 0)
            {
                return;
            }
            TournStaff         selectedItem       = (TournStaff)this.listStaff.SelectedItem;
            DialogSelectPerson dialogSelectPerson = new DialogSelectPerson();

            dialogSelectPerson.Title                 = "Add Staff";
            dialogSelectPerson.AllowNewPlayers       = true;
            dialogSelectPerson.EnableStaffPosition   = true;
            dialogSelectPerson.NewPlayer             = (IPlayer) new Player((IPlayer)selectedItem);
            dialogSelectPerson.SelectedStaffPosition = selectedItem.Position;
            if (dialogSelectPerson.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            this.listStaff.Items[this.listStaff.SelectedIndex] = (object)new TournStaff(dialogSelectPerson.NewPlayer)
            {
                Position = dialogSelectPerson.SelectedStaffPosition
            };
        }