Beispiel #1
0
        static void Main2(string[] args)
        {
            // Process all
            Console.WriteLine(VCRProfiles.GetSources("Nexus").Count());
            Console.WriteLine(VCRProfiles.GetSources("Nexus2").Count());

            // Create the filter
            ChannelFilter filter =
                new ChannelFilter
            {
                Profile      = "Nexus",
                ServiceType  = FilterServiceTypes.Radio,
                Encryption   = FilterEncryptionTypes.Free,
                Name         = "^[AB]",
                NameMatching = FilterNameMatching.RegularExpression
            };

            // Process
            foreach (Channel channel in VCRProfiles.GetSources(filter).ToChannels().OrderBy(c => c.UniqueName))
            {
                Console.WriteLine("{0} {1} {2} {3}", channel.UniqueName, channel.Station, channel.Source.DisplayName, channel.Source.SelectionKey);
            }

            // Done
            Console.ReadLine();
        }
        /// <summary>
        /// Erstellt eine neue Aktualisierung.
        /// </summary>
        /// <param name="state">Das zugehörige Geräteprofil.</param>
        /// <param name="recording">Daten der primären Aufzeichnung.</param>
        private ProgramGuideProxy(ProfileState state, VCRRecordingInfo recording)
            : base(state, recording)
        {
            // Reset fields
            if (VCRConfiguration.Current.EnableFreeSat)
            {
                m_extensions = EPGExtensions.FreeSatUK;
            }
            else
            {
                m_extensions = EPGExtensions.None;
            }

            // All sources we know about
            var allSources = new Dictionary <string, SourceSelection>(StringComparer.InvariantCultureIgnoreCase);

            // Load all sources of this profile
            foreach (var source in VCRProfiles.GetSources(ProfileName))
            {
                // Remember by direct name
                allSources[source.DisplayName] = source;

                // allSources by unique name
                allSources[source.QualifiedName] = source;
            }

            // Fill in all
            foreach (var legacyName in VCRConfiguration.Current.ProgramGuideSources)
            {
                // Skip if empty
                if (string.IsNullOrEmpty(legacyName))
                {
                    continue;
                }

                // Locate
                SourceSelection realSource;
                if (allSources.TryGetValue(legacyName, out realSource))
                {
                    m_selected.Add(realSource.Source);
                }
                else
                {
                    VCRServer.Log(LoggingLevel.Full, Properties.Resources.BadEPGStation, legacyName);
                }
            }
        }