Пример #1
0
        /** Reads:
         *  typeInfo{
         *      deprecated{
         *                  co{
         *                      direct{"true"}
         *                  }
         *                  tz{
         *                      camtr{"true"}
         *                  }
         *      }
         *  }
         */
        private static void GetTypeInfo(UResourceBundle typeInfoRes)
        {
            IDictionary <string, ISet <string> > _deprecatedKeyTypes = new Dictionary <string, ISet <string> >();  // ICU4N NOTE: As long as we don't delete, Dictionary keeps insertion order the same as LinkedHashMap

            foreach (var keyInfoEntry in typeInfoRes)
            {
                string       key      = keyInfoEntry.Key;
                TypeInfoType typeInfo = (TypeInfoType)Enum.Parse(typeof(TypeInfoType), key, true);
                foreach (var keyInfoEntry2 in keyInfoEntry)
                {
                    string        key2             = keyInfoEntry2.Key;
                    ISet <string> _deprecatedTypes = new HashSet <string>(); // ICU4N TODO: LinkedHashSet...?
                    foreach (var keyInfoEntry3 in keyInfoEntry2)
                    {
                        string key3 = keyInfoEntry3.Key;
                        switch (typeInfo)
                        { // allow for expansion
                        case TypeInfoType.deprecated:
                            _deprecatedTypes.Add(key3);
                            break;
                        }
                    }
                    _deprecatedKeyTypes[key2] = _deprecatedTypes.ToUnmodifiableSet();
                }
            }
            DEPRECATED_KEY_TYPES = _deprecatedKeyTypes.ToUnmodifiableDictionary();
        }
Пример #2
0
        /** Reads:
         *  typeInfo{
         *      deprecated{
         *                  co{
         *                      direct{"true"}
         *                  }
         *                  tz{
         *                      camtr{"true"}
         *                  }
         *      }
         *  }
         */
        private static void GetTypeInfo(UResourceBundle typeInfoRes)
        {
            IDictionary <string, ISet <string> > _deprecatedKeyTypes = new JCG.LinkedDictionary <string, ISet <string> >();

            foreach (var keyInfoEntry in typeInfoRes)
            {
                string       key      = keyInfoEntry.Key;
                TypeInfoType typeInfo = (TypeInfoType)Enum.Parse(typeof(TypeInfoType), key, true);
                foreach (var keyInfoEntry2 in keyInfoEntry)
                {
                    string        key2             = keyInfoEntry2.Key;
                    ISet <string> _deprecatedTypes = new JCG.LinkedHashSet <string>();
                    foreach (var keyInfoEntry3 in keyInfoEntry2)
                    {
                        string key3 = keyInfoEntry3.Key;
                        switch (typeInfo)
                        { // allow for expansion
                        case TypeInfoType.deprecated:
                            _deprecatedTypes.Add(key3);
                            break;
                        }
                    }
                    _deprecatedKeyTypes[key2] = _deprecatedTypes.AsReadOnly();
                }
            }
            DEPRECATED_KEY_TYPES = _deprecatedKeyTypes.AsReadOnly();
        }