コード例 #1
0
        private void AddModifyDeleteForm_Load(object sender, EventArgs e)
        {
            if (management_type == ManagementType.ADD)
            {
                btnDelete.Visible = false;
                btnDelete.Enabled = false;
                btnAddUpdate.Text = "ADD";
            }
            else if (management_type == ManagementType.UPDATE_DELETE)
            {
                btnDelete.Visible = true;
                btnDelete.Enabled = true;
                btnAddUpdate.Text = "UPDATE";

                txtKanji.Enabled = false;

                // bring all properties of selected Kanji
                txtKanji.Text        = kanji.GetCharacter();
                numNumOfStroke.Value = kanji.GetNumOfStrokes();

                foreach (var item in kanji.GetKunyomi())
                {
                    lbKunyomiList.Items.Add(item);
                }

                foreach (var item in kanji.GetOnyomi())
                {
                    lbOnyomiList.Items.Add(item);
                }

                foreach (var item in kanji.GetMeaning())
                {
                    lbMeaningList.Items.Add(item);
                }

                foreach (var item in kanji.GetStructure())
                {
                    if (item == Structure.ADJACTIVE)
                    {
                        chkADJACTIVE.Checked = true;
                    }
                    if (item == Structure.ADVERB)
                    {
                        chkADVERB.Checked = true;
                    }
                    if (item == Structure.NOUN)
                    {
                        chkNOUN.Checked = true;
                    }
                    if (item == Structure.VERB)
                    {
                        chkVERB.Checked = true;
                    }
                }
            }
        }
コード例 #2
0
        private void DetailsForm_Load(object sender, EventArgs e)
        {
            lblKanji.Text        = kanji.GetCharacter();
            lblNumOfStrokes.Text = kanji.GetNumOfStrokes().ToString();

            foreach (var item in kanji.GetKunyomi())
            {
                lbKunyomiList.Items.Add(item);
            }

            foreach (var item in kanji.GetOnyomi())
            {
                lbOnyomiList.Items.Add(item);
            }

            foreach (var item in kanji.GetMeaning())
            {
                lbMeaningList.Items.Add(item);
            }

            foreach (var item in kanji.GetStructure())
            {
                if (item == Structure.ADJACTIVE)
                {
                    chkADJACTIVE.Checked = true;
                }
                if (item == Structure.ADVERB)
                {
                    chkADVERB.Checked = true;
                }
                if (item == Structure.NOUN)
                {
                    chkNOUN.Checked = true;
                }
                if (item == Structure.VERB)
                {
                    chkVERB.Checked = true;
                }
            }
        }