Example #1
0
 public void AddText(Text text)
 {
     if (!Texts.Any(x => x.Path == text.Path))
     {
         Texts.Add(text);
         SaveChanges();
     }
 }
Example #2
0
        //---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);
 }
Example #4
0
        /// <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;
        }
Example #5
0
 public bool HasModifier()
 {
     return(Texts.Any(
                text => text.IsModifier));
 }
Example #6
0
 public bool HasPastParticiple()
 {
     return(Texts.Any(
                text => text.IsType(UnitTypes.PAST_Participle)));
 }
Example #7
0
 public bool HasVbaVerb()
 {
     return(Texts.Any(
                text => text.IsType(UnitTypes.VBA_AuxilliaryVerb)));
 }
Example #8
0
 public bool HasVbVerb()
 {
     return(Texts.Any(
                text => text.IsType(UnitTypes.VB_Verb)));
 }
Example #9
0
 public bool HasTimer()
 {
     return(Texts.Any(
                text => text.IsTimer));
 }
Example #10
0
 public bool HasAdverb()
 {
     return(Texts.Any(
                text => text.IsAdverb));
 }
Example #11
0
 public bool HasClauser()
 {
     return(Texts.Any(
                text =>
                text.IsClauser));
 }
Example #12
0
 public override bool IsValid()
 {
     return(QuestionnaireId > 0 && Subjects.Any() && Texts.Any());
 }