예제 #1
0
        private static void ReadFile(StreamReader streamReader, string section, Dictionary <string, Dictionary <string, List <string> > > channels)
        {
            INIReader iniReader = new INIReader(streamReader);
            string    country   = iniReader.GetEntry(section, "1");

            if (country != null)
            {
                Dictionary <string, List <string> > regions;
                if (!channels.TryGetValue(country, out regions))
                {
                    channels[country] = regions = new Dictionary <string, List <string> >();
                }

                string region = iniReader.GetEntry(section, "2");
                if (region != null)
                {
                    List <string> frequencies;
                    if (!regions.TryGetValue(region, out frequencies))
                    {
                        regions[region] = frequencies = new List <string>();
                    }

                    string numberOfFrequencies = iniReader.GetEntry("DVB", "0");
                    if (numberOfFrequencies != null)
                    {
                        int count = int.Parse(numberOfFrequencies);
                        for (int i = 1; i <= count; i++)
                        {
                            frequencies.Add(iniReader.GetEntry("DVB", i.ToString()));
                        }
                    }
                }
            }
        }
예제 #2
0
        private static void ReadFile(StreamReader streamReader, string section, Dictionary<string, Dictionary<string, List<string>>> channels)
        {
            INIReader iniReader = new INIReader(streamReader);
            string country = iniReader.GetEntry(section, "1");
            if (country != null)
            {
                Dictionary<string, List<string>> regions;
                if (!channels.TryGetValue(country, out regions))
                    channels[country] = regions = new Dictionary<string, List<string>>();

                string region = iniReader.GetEntry(section, "2");
                if (region != null)
                {
                    List<string> frequencies;
                    if (!regions.TryGetValue(region, out frequencies))
                        regions[region] = frequencies = new List<string>();

                    string numberOfFrequencies = iniReader.GetEntry("DVB", "0");
                    if (numberOfFrequencies != null)
                    {
                        int count = int.Parse(numberOfFrequencies);
                        for (int i = 1; i <= count; i++)
                            frequencies.Add(iniReader.GetEntry("DVB", i.ToString()));
                    }
                }
            }
        }