private void LoadMappingFileProvider()
        {
            var files    = new SortedDictionary <int, HashSet <String> >();
            var asm      = Redirections.GetAssembly();
            var allNames = asm.GetManifestResourceNames();
            var prefix   = asm.GetName().Name + "." + phonePrefixDataDirectory;
            var names    = allNames.Where(n => n.StartsWith(prefix));

            foreach (var n in names)
            {
                var name = n.Substring(prefix.Length);
                var pos  = name.IndexOf("_");
                int country;
                try
                {
                    country = int.Parse(name.Substring(0, pos));
                }
                catch (FormatException)
                {
                    throw new Exception("Failed to parse geocoding file name: " + name);
                }
                var language = name.Substring(pos + 1);
                if (!files.ContainsKey(country))
                {
                    files[country] = new HashSet <String>();
                }
                files[country].Add(language);
            }
            mappingFileProvider = new MappingFileProvider();
            mappingFileProvider.ReadFileConfigs(files);
        }
        public static Dictionary <int, List <String> > GetCountryCodeToRegionCodeMap(String filePrefix)
        {
            var asm  = Redirections.GetAssembly();
            var name = asm.GetManifestResourceNames().FirstOrDefault(n => n.EndsWith(filePrefix)) ?? "missing";

            using (var stream = asm.GetManifestResourceStream(name))
            {
                var collection = BuildPhoneMetadataCollection(stream, false);
                return(BuildCountryCodeToRegionCodeMap(collection));
            }
        }
        private void LoadAreaCodeMapFromFile(String fileName)
        {
            var asm     = Redirections.GetAssembly();
            var prefix  = asm.GetName().Name + "." + phonePrefixDataDirectory;
            var resName = prefix + fileName;

            using (var fp = asm.GetManifestResourceStream(resName))
            {
                var areaCodeMap = AreaCodeParser.ParseAreaCodeMap(fp);
                availablePhonePrefixMaps[fileName] = areaCodeMap;
            }
        }
        static private void LoadMedataFromFile(String filePrefix)
        {
            var asm  = Redirections.GetAssembly();
            var name = asm.GetManifestResourceNames().FirstOrDefault(n => n.EndsWith(filePrefix)) ?? "missing";

            using (var stream = asm.GetManifestResourceStream(name))
            {
                var meta = BuildMetadataFromXml.BuildPhoneMetadataCollection(stream, false);
                foreach (var m in meta.MetadataList)
                {
                    callingCodeToAlternateFormatsMap[m.CountryCode] = m;
                }
            }
        }