private term(term t1, term t2) { Kind = TermKind.Apply; _atom = default(atom); _applyF = new Box <term>(t1); _applyX = new Box <term>(t2); }
private term(TermKind kind, atom a) { Kind = kind; _atom = a; _applyF = new Box <term>(default(term)); _applyX = new Box <term>(default(term)); }
public void LoadAnswers(TermKind from, TermKind to) { FromTerm = from; ToTerm = to; questions.Clear(); string[] input = new string[0]; if (File.Exists(AnswerDataFileName)) { input = File.ReadAllLines(AnswerDataFileName); } for (int i = 0; i < questionData.Count; ++i) { QuestionData qd = questionData[i]; Question q = new Question(); GetQuestionAnswerData(from, qd, out q.QuestionStyle, out q.QuestionString); GetQuestionAnswerData(to, qd, out q.AnswerStyle, out q.AnswerString); if (i < input.Length) { q.LoadAnswers(input[i]); } questions.Add(q); } }
void GetQuestionAnswerData(TermKind termKind, QuestionData qd, out TermStyle termStyle, out string termString) { if (termKind == TermKind.ChineseCharacter) { if (string.IsNullOrWhiteSpace(qd.ChineseImageFileName)) { termStyle = TermStyle.Text; termString = qd.ChineseText; } else { termStyle = TermStyle.Picture; termString = Path.Combine(directory, qd.ChineseImageFileName); } } else if (termKind == TermKind.ChineseSound) { termStyle = TermStyle.Sound; termString = Path.Combine(directory, qd.SoundFileName); } else if (termKind == TermKind.EnglishWord) { termStyle = TermStyle.Text; termString = qd.EnglishText; } else { throw new ArgumentException("termKind"); } }
private string TermText(TermKind termKind) { switch (termKind) { case TermKind.ChineseCharacter: return("chin"); case TermKind.ChineseSound: return("sound"); case TermKind.EnglishWord: default: return("eng"); } }
private string TermText(TermKind termKind) { switch (termKind) { case TermKind.ChineseCharacter: return "chin"; case TermKind.ChineseSound: return "sound"; case TermKind.EnglishWord: default: return "eng"; } }
public NameClause(TermKind kind, string filter, bool substring) { Kind = kind; Filter = filter; Substring = substring; }
internal Term(string name, TermKind kind) { Name = name; Kind = kind; }