Exemple #1
0
 public DialogSelectPerson()
 {
     this.InitializeComponent();
     this.ddlStaffPosition.Items.Clear();
     foreach (StaffPosition pos in (StaffPosition[])Enum.GetValues(typeof(StaffPosition)))
     {
         if (pos != StaffPosition.None)
         {
             this.ddlStaffPosition.Items.Add((object)new DropListItem(TournStaff.GetName(pos), (object)pos));
         }
     }
     this.ddlStaffPosition.SelectedIndex = 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
            };
        }