Пример #1
0
        /// <summary>
        /// Get the writing systems we should actually display right now. That is, from the ones
        /// that are currently possible, select any we've previously configured to show.
        /// </summary>
        private IEnumerable <IWritingSystem> GetVisibleWritingSystems(string singlePropertySequenceValue)
        {
            string[] wsIds   = ChoiceGroup.DecodeSinglePropertySequenceValue(singlePropertySequenceValue);
            var      wsIdSet = new HashSet <string>(wsIds);

            return(from ws in WritingSystemOptionsForDisplay
                   where wsIdSet.Contains(ws.Id)
                   select ws);
        }
Пример #2
0
        private ILgWritingSystem[] GetVisibleWritingSystems(string singlePropertySequenceValue)
        {
            string[]     icuLocales   = ChoiceGroup.DecodeSinglePropertySequenceValue(singlePropertySequenceValue);
            Set <string> icuLocaleSet = new Set <string>(icuLocales);
            List <int>   wsList       = new List <int>();

            // convert the icu locale ids into hvo ids.
            foreach (ILgWritingSystem lws in WritingSystemOptionsForDisplay)
            {
                if (icuLocaleSet.Contains(lws.ICULocale))
                {
                    wsList.Add(lws.Hvo);
                }
            }
            // convert the ws hvos into ws object array.
            return(LabeledMultiStringView.WssFromHvos(wsList.ToArray(), Cache));
        }