public void AddText(Text text) { if (!Texts.Any(x => x.Path == text.Path)) { Texts.Add(text); SaveChanges(); } }
//---by hp--- private M_QuestionnaireResultDetail TextAndRadioToDetail() { if (Texts == null || Texts.Any(p => string.IsNullOrEmpty(p.Text))) { return(null); } if (Radios == null || !Radios.Any()) { return(null); } var score = 0; var result = string.Empty; //先加入填空值 for (int i = 0; i < Texts.Length; i++) { result += Texts[i].Text + ","; } for (var i = 0; i < Radios.Length; i++) { if (!Radios[i].Checked) { continue; } result += string.Format("{0},", (char)('A' + i)); score = Convert.ToInt32(Radios[i].Tag ?? 0); break; } return(new M_QuestionnaireResultDetail { QuestionResult = result, QuestionScore = score, QuestionType = Type, QuestionCode = Code, PQuestionWeightScore = score * Weight }); }
public bool SentenceHasSingleModifierAndPyXuyaoUnit() { return(Texts.Any(text => text.IsPyXuyao) && Texts.Count(text => text.IsModifier) == 1); }
/// <summary> /// Отслеживает авторские тексты для коррекции IsNew автора /// </summary> /// <param name="sender">игнорируется</param> /// <param name="e">игнорируется</param> private void TextsListChanged(object sender, ListChangedEventArgs e) { bool summaryIsNew = Texts.Any(authorText => authorText.IsNew); IsNew = summaryIsNew; }
public bool HasModifier() { return(Texts.Any( text => text.IsModifier)); }
public bool HasPastParticiple() { return(Texts.Any( text => text.IsType(UnitTypes.PAST_Participle))); }
public bool HasVbaVerb() { return(Texts.Any( text => text.IsType(UnitTypes.VBA_AuxilliaryVerb))); }
public bool HasVbVerb() { return(Texts.Any( text => text.IsType(UnitTypes.VB_Verb))); }
public bool HasTimer() { return(Texts.Any( text => text.IsTimer)); }
public bool HasAdverb() { return(Texts.Any( text => text.IsAdverb)); }
public bool HasClauser() { return(Texts.Any( text => text.IsClauser)); }
public override bool IsValid() { return(QuestionnaireId > 0 && Subjects.Any() && Texts.Any()); }