PKHeX.CodeGenerator.changeDataSource C# (CSharp) Method

changeDataSource() private method

private changeDataSource ( object sender, EventArgs e ) : void
sender object
e EventArgs
return void
        private void changeDataSource(object sender, EventArgs e)
        {
            int sourceindex = CB_Source.SelectedIndex;
            B_Add.Enabled = true;

            if (sourceindex == 0)
            {
                // Hide Box/Etc
                CB_Box.Visible = false;
                L_Box.Visible = false;
                CB_Slot.Visible = false;
                L_Slot.Visible = false;

                TB_Write.Text = (0x27A00 - 0x5400).ToString("X8"); // Box 1, Slot 1
            }
            else if (sourceindex == 1)
            {
                CB_Box.Visible = L_Box.Visible = true;
                CB_Slot.Visible = L_Slot.Visible = true;

                L_Slot.Text = "Slot:";

                CB_Slot.Items.Clear();
                for (int i = 1; i <= 30; i++)
                    CB_Slot.Items.Add(i.ToString());

                CB_Slot.SelectedIndex = 0;

                TB_Write.Text = (0x27A00 - 0x5400).ToString("X8"); // Box 1, Slot 1
            }
            else if (sourceindex == 2)
            {
                CB_Box.Visible = L_Box.Visible = false;
                CB_Slot.Visible = L_Slot.Visible = true;

                L_Slot.Text = "Card:";

                // Set up cards
                CB_Slot.Items.Clear();
                for (int i = 1; i <= 24; i++)
                    CB_Slot.Items.Add(i.ToString());

                CB_Slot.SelectedIndex = 0;
                TB_Write.Text = (0x22000 - 0x5400).ToString("X8"); // WC Slot 1
            }
        }