public EngEditMean(EngWord.mean target) { InitializeComponent(); this.mean = target; this.bxType.Text = this.bxType.Items[(int)this.mean.type].ToString(); this.textBox1.Text = target.content; for (int i = 0; i < 19; i++) { this.chkbxAttr.SetItemChecked(i, this.getAttr(i)); } /* * this.chkbxAttr.SetItemChecked(0,target.Proper); * this.chkbxAttr.SetItemChecked(1,target.Collective); * this.chkbxAttr.SetItemChecked(2,target.Abstract); * this.chkbxAttr.SetItemChecked(3,target.Material); * this.chkbxAttr.SetItemChecked(4,target.SV); * this.chkbxAttr.SetItemChecked(5,target.SVC); * this.chkbxAttr.SetItemChecked(6,target.SVO); * this.chkbxAttr.SetItemChecked(7,target.SVOO); * this.chkbxAttr.SetItemChecked(8,target.SVOC); * this.chkbxAttr.SetItemChecked(9,target.Reflexive); * this.chkbxAttr.SetItemChecked(10,target.Causative); * this.chkbxAttr.SetItemChecked(11,target.Factive); * this.chkbxAttr.SetItemChecked(12,target.Stative); * this.chkbxAttr.SetItemChecked(13,target.Sensational); * this.chkbxAttr.SetItemChecked(14,target.Interrogative); * this.chkbxAttr.SetItemChecked(15,target.RelativePronoun); * this.chkbxAttr.SetItemChecked(16,target.RelativeAdverb); * this.chkbxAttr.SetItemChecked(17,target.Phrase); * this.chkbxAttr.SetItemChecked(18,target.Clause); */ this.chkbxUsage.SetItemChecked(0, target.Nominal); this.chkbxUsage.SetItemChecked(1, target.PluralNominal); this.chkbxUsage.SetItemChecked(2, target.Attributive); this.chkbxUsage.SetItemChecked(3, target.Predicative); this.chkbxUsage.SetItemChecked(4, target.Adjunct); }
private void treeView1_AfterSelect(object sender, System.Windows.Forms.TreeViewEventArgs e) { string msg; int index; if (e.Node.Parent != null) { //親の問い合わせ msg = e.Node.Parent.Tag.ToString(); if (!msg.StartsWith("Mean")) { return; } index = System.Int32.Parse(msg.Substring(4)); if (index >= this.dtWord.meaning.Count) { return; } EngWord.mean parent = this.dtWord.meaning[index]; //子をコントロールに登録・表示 msg = e.Node.Tag.ToString(); index = System.Int32.Parse(msg.Substring(4)); if (index < 0) { return; } switch (msg.Substring(0, 4)) { case "Sent": this.panel1.Controls.Clear(); if (parent.sentence.Count > index) { //TODO: 例文を編集するコントロール(parent.sentence[index]) } break; case "Rela": this.panel1.Controls.Clear(); if (parent.relative.Count > index) { //TODO: 関連語を編集するコントロール(parent.relative[index]) } break; } } else { msg = e.Node.Tag.ToString(); index = System.Int32.Parse(msg.Substring(4)); if (index < 0) { return; } switch (msg.Substring(0, 4)) { case "Mean": this.panel1.Controls.Clear(); if (this.dtWord.meaning.Count > index) { this.panel1.Controls.Add(new EngEditMean(this.dtWord.meaning[index])); } break; case "Rela": this.panel1.Controls.Clear(); if (this.dtWord.relative.Count > index) { //TODO: 関連語を編集するコントロール(this.dtWord.relative[index]) } break; } } }