예제 #1
0
        public bool SetCurrentTabById(string id)
        {
            bool retVal = false;

            if (SubItems != null)
            {
                var tab = SubItems.FirstOrDefault(x => x.IdTab == id);
                if (tab != null)
                {
                    CurrentTab = tab;
                    retVal     = true;
                }
            }
            return(retVal);
        }
예제 #2
0
 public void AddQuestion(QuestionViewModel question, int termId)
 {
     try
     {
         if (termId == TermId)
         {
             Questions += 1;
         }
         else
         {
             var subitem = SubItems.FirstOrDefault(x => x.TermId == termId);
             subitem.Questions += 1;
         }
     }
     catch (Exception)
     {
         throw new Exception("QuestionId: " + question.Id);
     }
 }
예제 #3
0
 public T GetSubItem <T>(string name) where T : RegistryKeyItemBase
 {
     return(SubItems.FirstOrDefault(i => i.Text.Equals(name, StringComparison.InvariantCultureIgnoreCase)) as T);
 }