Esempio n. 1
0
 public StringEntry(string stringId, string val, LocalizedStringList group, LocalizedString baseString)
 {
     _stringId = stringId;
     _val = val;
     Group = group;
     Base = baseString;
 }
Esempio n. 2
0
 private void cbLocaleGroups_SelectionChanged_1(object sender, SelectionChangedEventArgs e)
 {
     var group = cbLocaleGroups.SelectedItem as NamedStringList;
     if (group != null)
     {
         _currentGroup = group.Base;
         _stringView.CurrentGroup = group.Base;
         _stringView.Refresh();
         lvLocales.CanUserAddRows = (group.Base != null);
         ShowCurrentItem();
     }
 }
Esempio n. 3
0
 /// <summary>
 ///     Wraps the strings in a <see cref="LocalizedStringList" />.
 /// </summary>
 /// <param name="list">The list to wrap.</param>
 /// <returns>The wrapped strings.</returns>
 private IEnumerable<StringEntry> WrapStrings(LocalizedStringList list)
 {
     return list.Strings.Select(s =>
     {
         string stringIdName = _cache.StringIDs.GetString(s.Key) ?? s.Key.ToString();
         string adjustedStr = ReplaceSymbols(s.Value);
         var entry = new StringEntry(stringIdName, adjustedStr, list, s);
         return entry;
     });
 }
Esempio n. 4
0
        /// <summary>
        ///     Builds the string list table.
        /// </summary>
        /// <param name="reader">The stream to read strings from.</param>
        private void BuildStringLists(IReader reader)
        {
            List<LocalizedString> table = _language.LoadStrings(reader);

            // Extract each group's section of the string table into a separate list
            foreach (ThirdGenMultilingualStringList group in _groups)
            {
                int startIndex = group.Ranges[_languageIndex].StartIndex;
                int size = group.Ranges[_languageIndex].Size;
                List<LocalizedString> strings = table.Skip(startIndex).Take(size).ToList();
                var list = new LocalizedStringList(group.Tag, strings);
                _stringLists.Add(list);
            }
            StringLists = _stringLists.AsReadOnly();
        }