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); }
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); } }
public T GetSubItem <T>(string name) where T : RegistryKeyItemBase { return(SubItems.FirstOrDefault(i => i.Text.Equals(name, StringComparison.InvariantCultureIgnoreCase)) as T); }