Ejemplo n.º 1
0
        static void Main7( string[] args )
        {
            // Attach to job manager
            VCRServer server = new VCRServer( new DirectoryInfo( @"C:\temp\VCR.NET 3.9 Alpha\Jobs" ) );
            JobManager jobs = server.JobManager;

            ProgramGuideEntries entries = new ProgramGuideEntries();
            entries.Add( new ProgramGuideEntry { Name = "Te\x0005st" } );
            SerializationTools.Save( entries, @"c:\temp\test.xml" );
            ProgramGuideEntries reload = SerializationTools.Load<ProgramGuideEntries>( new FileInfo( @"c:\temp\test.xml" ) );
        }
Ejemplo n.º 2
0
        static void Main7(string[] args)
        {
            // Attach to job manager
            VCRServer  server = new VCRServer(new DirectoryInfo(@"C:\temp\VCR.NET 3.9 Alpha\Jobs"));
            JobManager jobs   = server.JobManager;

            ProgramGuideEntries entries = new ProgramGuideEntries();

            entries.Add(new ProgramGuideEntry {
                Name = "Te\x0005st"
            });
            SerializationTools.Save(entries, @"c:\temp\test.xml");
            ProgramGuideEntries reload = SerializationTools.Load <ProgramGuideEntries>(new FileInfo(@"c:\temp\test.xml"));
        }
        /// <summary>
        /// Beendet die Sammlung endgültig.
        /// </summary>
        protected override void OnStop()
        {
            // At least we tried
            ProfileState.ProgramGuide.LastUpdateTime = DateTime.UtcNow;

            // Report
            Tools.ExtendedLogging("Converting Program Guide Entries from Card Server to VCR.NET Format");

            // Create result
            var result = new ProgramGuideEntries();

            // Fill it
            foreach (var item in Server.BeginEndEPGCollection().Result)
            {
                // Create event
                var epg =
                    new ProgramGuideEntry
                {
                    TransportIdentifier = item.Source.TransportStream,
                    ShortDescription    = item.ShortDescription,
                    NetworkIdentifier   = item.Source.Network,
                    ServiceIdentifier   = item.Source.Service,
                    Description         = item.Description,
                    Duration            = item.Duration,
                    Language            = item.Language,
                    StartTime           = item.Start,
                    Name = item.Name
                };

                // Finish
                if (item.Content != null)
                {
                    epg.Categories.AddRange(item.Content.Select(c => c.ToString()));
                }
                if (item.Ratings != null)
                {
                    epg.Ratings.AddRange(item.Ratings);
                }

                // Resolve
                var source = VCRProfiles.FindSource(ProfileName, item.Source);
                if (source == null)
                {
                    // Load default
                    epg.StationName = item.Source.ToString();
                }
                else
                {
                    // Attach to the station
                    var station = (Station)source.Source;

                    // Load names
                    epg.StationName = station.Name;
                }

                // Add it
                result.Add(epg);
            }

            // Report
            ProfileState.ProgramGuide.UpdateGuide(result);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Beendet die Sammlung endgültig.
        /// </summary>
        protected override void OnStop()
        {
            // At least we tried
            ProfileState.ProgramGuide.LastUpdateTime = DateTime.UtcNow;

            // Report
            Tools.ExtendedLogging( "Converting Program Guide Entries from Card Server to VCR.NET Format" );

            // Create result
            var result = new ProgramGuideEntries();

            // Fill it
            foreach (var item in Server.BeginEndEPGCollection().Result)
            {
                // Create event
                var epg =
                    new ProgramGuideEntry
                    {
                        TransportIdentifier = item.Source.TransportStream,
                        ShortDescription = item.ShortDescription,
                        NetworkIdentifier = item.Source.Network,
                        ServiceIdentifier = item.Source.Service,
                        Description = item.Description,
                        Duration = item.Duration,
                        Language = item.Language,
                        StartTime = item.Start,
                        Name = item.Name
                    };

                // Finish
                if (item.Content != null)
                    epg.Categories.AddRange( item.Content.Select( c => c.ToString() ) );
                if (item.Ratings != null)
                    epg.Ratings.AddRange( item.Ratings );

                // Resolve
                var source = VCRProfiles.FindSource( ProfileName, item.Source );
                if (source == null)
                {
                    // Load default
                    epg.StationName = item.Source.ToString();
                }
                else
                {
                    // Attach to the station
                    var station = (Station) source.Source;

                    // Load names
                    epg.StationName = station.Name;
                }

                // Add it
                result.Add( epg );
            }

            // Report
            ProfileState.ProgramGuide.UpdateGuide( result );
        }