public UIAnswerOrNoteDataString(Question baseQuestion, LocalizableStringType type, int index) { Debug.Assert(type == LocalizableStringType.Answer || type == LocalizableStringType.Note); m_baseQuestion = baseQuestion; Type = type; m_index = index; }
public UITestDataString(string source, LocalizableStringType type, int startRef = 0, int endRef = 0, string question = null, bool useAnyAlt = true) { SourceUIString = source; Type = type; StartRef = startRef; EndRef = endRef; Question = question ?? (type == LocalizableStringType.Question ? source : null); UseAnyAlternate = useAnyAlt; }
internal IReadOnlyList <TranslationUnit> GetQuestionSubgroupTranslationUnits(Question question, LocalizableStringType type) { switch (type) { case LocalizableStringType.Alternate: case LocalizableStringType.Answer: case LocalizableStringType.Note: UIDataString key = new UIQuestionDataString(question, true, false); return(Localizations.FindQuestionGroup(key)?.GetQuestionSubGroup(type)?.TranslationUnits); default: throw new ArgumentOutOfRangeException(); } }
public UISimpleDataString(string source, LocalizableStringType type) { Debug.Assert(type == LocalizableStringType.Category || type == LocalizableStringType.NonLocalizable); SourceUIString = source; Type = type; }
private void AddAnswerOrNoteSubgroupAndLocalizableStringsIfNeeded(Question q, Group questionGroup, LocalizableStringType type, Func <Question, string[]> data) { var stringsToAdd = data(q); if (stringsToAdd != null) { var subGroup = questionGroup.GetQuestionSubGroup(type) ?? questionGroup.AddSubGroup(type.SubQuestionGroupId()); for (var index = 0; index < stringsToAdd.Length; index++) { if (String.IsNullOrWhiteSpace(stringsToAdd[index])) { continue; } var key = new UIAnswerOrNoteDataString(q, type, index); AddTranslationUnit(subGroup, key); } } }