private void editMade(object sender, EventArgs e) { if (autoMode == false) { autoMode = true; Transitivity transitivity = Transitivity.ditransitive; if (DOcheck.Checked == true) { if (IOcheck.Checked == true) { transitivity = Transitivity.ditransitive; } else { transitivity = Transitivity.transitiveDirect; } } else { if (IOcheck.Checked == true) { transitivity = Transitivity.transitiveIndirect; } else { transitivity = Transitivity.intransitive; } } int removeIndex = dictionary.verbs.FindLastIndex( (otherverb) => { if (otherverb.randomtag == currentrandomtag) { return(true); } return(false); } ); dictionary.verbs.RemoveAt(removeIndex); string oldEnglishInfinitive = selectedVerb.englishInfinitive; string oldSpanishInfinitive = selectedVerb.spanishInfinitive; selectedVerb = new Verb(new TenseArray(en1st.Text, en2nd.Text, en3rd.Text, en4th.Text, en5th.Text, en6th.Text), ((englishInfinitive.Text.StartsWith("to ")) ? englishInfinitive.Text.Substring(3) : englishInfinitive.Text), englishParticiple.Text, new TenseArray(es1st.Text, es2nd.Text, es3rd.Text, es4th.Text, es5th.Text, es6th.Text), (spanishInfinitive.Text.EndsWith("se") ? spanishInfinitive.Text.Substring(0, spanishInfinitive.Text.Length - 2) : spanishInfinitive.Text), spanishParticiple.Text, new CommandForms(affTu.Text, affUd.Text, affNos.Text, affUds.Text, negTu.Text, negUd.Text, negNos.Text, negUds.Text), transitivity); currentrandomtag = selectedVerb.randomtag = DateTime.Now; dictionary.verbs.Insert(removeIndex, selectedVerb); int index = verbListBox.Items.IndexOf((string)(oldEnglishInfinitive + " — " + oldSpanishInfinitive)); verbListBox.Items[index] = (selectedVerb.englishInfinitive + " — " + selectedVerb.spanishInfinitive); } autoMode = false; }
public Verb(Verb verb) { this.randomtag = verb.randomtag; this.englishForms = verb.englishForms; this.englishInfinitive = verb.englishInfinitive; this.englishParticiple = verb.englishParticiple; this.spanishForms = verb.spanishForms; this.spanishInfinitive = verb.spanishInfinitive; this.spanishParticiple = verb.spanishParticiple; this.spanishCommandForms = verb.spanishCommandForms; this.transitivity = verb.transitivity; }
public Verb(int number) { this.randomtag = DateTime.UtcNow; this.englishForms = new TenseArray("", "", "", "", "", ""); this.englishInfinitive = "Verb" + number.ToString(); this.englishParticiple = ""; this.spanishForms = new TenseArray("", "", "", "", "", ""); this.spanishInfinitive = "Verbo" + number.ToString(); this.spanishParticiple = ""; this.spanishCommandForms = new CommandForms("", "", "", "", ""); this.transitivity = Transitivity.ditransitive; }
public Verb(TenseArray englishForms, String englishInfinitive, String englishParticiple, TenseArray spanishForms, String spanishInfinitive, String spanishParticiple, CommandForms spanishCommandForms, Transitivity transitivity) { this.randomtag = DateTime.UtcNow; this.englishForms = englishForms; this.englishInfinitive = englishInfinitive; this.englishParticiple = englishParticiple; this.spanishForms = spanishForms; this.spanishInfinitive = spanishInfinitive; this.spanishParticiple = spanishParticiple; this.spanishCommandForms = spanishCommandForms; this.transitivity = transitivity; }