コード例 #1
0
ファイル: Form1.cs プロジェクト: ppaier/HFCSharp
        private void comboBoxPartyType_SelectedIndexChanged(object sender, EventArgs e)
        {
            if(comboBoxPartyType.SelectedIndex==0)
            {
                currentParty = birthdayParty;
                currentParty.FancyDecorations = checkBoxFancy.Checked;
                currentParty.NumberOfPeople = (int) numericUpDownNumPeople.Value;
                birthdayParty.CakeWriting = textBoxCakeWriting.Text;
                labelTooLong.Visible = birthdayParty.CakeWritingTooLong;

                checkBoxHealthy.Enabled = false;
                textBoxCakeWriting.Enabled = true;
            }
            else
            {
                currentParty = dinnerParty;
                currentParty.FancyDecorations = checkBoxFancy.Checked;
                currentParty.NumberOfPeople = (int)numericUpDownNumPeople.Value;
                dinnerParty.HealthyOption = checkBoxHealthy.Checked;

                checkBoxHealthy.Enabled = true;
                textBoxCakeWriting.Enabled = false;
                labelTooLong.Visible = false;
            }

            DisplayPartyCost();
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: ppaier/HFCSharp
        public Form1()
        {
            InitializeComponent();

            birthdayParty = new BirthdayParty((int)numericUpDownNumPeople.Value, checkBoxHealthy.Checked, "");
            dinnerParty = new DinnerParty((int)numericUpDownNumPeople.Value, checkBoxHealthy.Checked, checkBoxFancy.Checked);

            currentParty = birthdayParty;
            comboBoxPartyType.SelectedIndex = 0;
            DisplayPartyCost();
        }