public frmWordEdit(ref 英単語の練習.Word word) { InitializeComponent(); this.word1 = word; this.word2 = this.word1; //this.propertyGrid1.SelectedObject=this.word1; }
/// <summary>正解・不正解を単語の情報に加えます</summary> /// <param name="right">正解したかどうかを指定</param> public void count(bool right) { this.q1++; 英単語の練習.Word word0 = (英単語の練習.Word)form1.wordList[anum]; word0.shutsudai++; if (right) { word0.seikai++; } /* * int n=System.Int32.Parse(form1.listView1.Items[anum].SubItems[4].Text)+1; * form1.listView1.Items[anum].SubItems[4].Text=n.ToString(); * if(right){ * this.q2++; * n=System.Int32.Parse(form1.listView1.Items[anum].SubItems[5].Text)+1; * form1.listView1.Items[anum].SubItems[5].Text=n.ToString(); * } */ int q3 = (int)(q2 * 25 / q1); int i; string text = ""; if (q3 > 0) { for (i = 1; i <= q3; i++) { text += "■"; } } while (text.Length < 25) { text += "□"; } this.label4.Text = "正答率" + text; }
/// <summary>乱数によって次に出題される単語を選び出し、出題します。</summary> public void next() { if (form1.listView1.Items.Count == 0) { this.timer1.Enabled = false; return; } int r1 = (int)rnd1.Next(form1.listView1.Items.Count); if (r1 == form1.listView1.Items.Count) { r1 = 0; } this.anum = r1; 英単語の練習.Word word0 = (英単語の練習.Word)form1.wordList[r1]; this.a = word0.mean; this.b = word0.word; /* * this.a=form1.listView1.Items[r1].SubItems[2].Text; * this.b=form1.listView1.Items[r1].SubItems[0].Text; */ this.bcou = 0; this.label1.Text = this.a; this.label2.Text = ""; this.label3.Text = ""; this.timer1.Interval = 2000; }
public editWordCtl(英単語の練習.Word word) { InitializeComponent(); this.Word = word.word; this.Pronounce = word.pron; this.Mean = word.mean; this.Part = word.Part; }
public void setWord(英単語の練習.Word word) { this.Word = word.word; this.Mean = word.mean; this.Pronounce = word.pron; this.Part = this.Part; this.txtWord.Focus(); }
/// <summary>個々の単語の情報をファイル内に書き込みます。</summary> /// <param name="w">書き込む単語の情報を格納している 英単語の練習.Word を指定。</param> public void writeWordData(英単語の練習.Word w) { xtw.WriteStartElement("word"); { xtw.WriteAttributeString("name", this.escape(w.word + ((w.pron == "")?"":"|" + w.pron))); xtw.WriteAttributeString("mean", this.escape(w.mean)); xtw.WriteStartElement("part"); { xtw.WriteAttributeString("value", this.escape(w.part.partString)); xtw.WriteAttributeString("conjugate", this.escape(w.strConjugate)); } xtw.WriteEndElement(); string nm; //typ nm 参照語の情報を指定する文字列を格納 int rwl, exl; //rwl は参照の、 exl は例文の、数を表します。 if ((rwl = w.referWord.Count) != 0) { for (int i = 0; i < rwl; i++) //if( 〜=0)はいらないかも(Count=0になることはない?) { refWord rfword = (refWord)w.referWord[i]; if ((nm = rfword.word.Trim()) != "") { if (rfword.pron != "") { nm += "|" + rfword.pron; } xtw.WriteStartElement("ref"); xtw.WriteAttributeString("type", rfword.typeString); xtw.WriteAttributeString("name", this.escape(nm)); if (rfword.mean != "") { xtw.WriteAttributeString("mean", this.escape(rfword.mean)); } xtw.WriteAttributeString("part", rfword.part.partString); xtw.WriteEndElement(); } } } if ((exl = w.example.Length) != 0) { for (int i = 0; i < exl; i++) //if( 〜=0)はいらないかも(length=0になることはない?) { if (w.example[i].Trim() != "") { xtw.WriteElementString("xmp", this.escape(w.example[i])); } } } xtw.WriteStartElement("exam"); { xtw.WriteAttributeString("shutsudai", w.shutsudai.ToString()); xtw.WriteAttributeString("seikai", w.seikai.ToString()); } xtw.WriteEndElement(); } xtw.WriteEndElement(); }