Exemplo n.º 1
0
        private void toolStripViewPlayer_Click(object sender, EventArgs e)
        {
            if (playerGrid.SelectedRows.Count == 1)
            {
                Player player = (Player)playerGrid.SelectedRows[0].DataBoundItem;

                if (player is Batter)
                {
                    ShowBatterForm frm = new ShowBatterForm((Batter)player);
                    frm.ShowDialog();
                }
                else if (player is Pitcher)
                {
                    ShowPitcherForm frm = new ShowPitcherForm((Pitcher)player);
                    frm.ShowDialog();
                }
                else
                {
                    MessageBox.Show("Invalid player type.");
                }
            }
        }
Exemplo n.º 2
0
        void bullpenListView_DoubleClick(object sender, System.EventArgs e)
        {
            if (bullpenListView.SelectedItems.Count == 1)
            {
                Pitcher ptr = (Pitcher)bullpenListView.SelectedItems[0].Tag;
                ShowPitcherForm frm = new ShowPitcherForm(ptr);

                frm.ShowDialog();
            }
        }