/// <summary> /// Erstellt einen neuen Zustand. /// </summary> /// <param name="target">Das aktuelle Ziel des Datenversands.</param> /// <param name="server">Die zugehörigen Informationen des Aufzeichnungsprozesses.</param> /// <returns>Der gwünschte Zustand.</returns> public static ZappingStatus Create( string target, ServerInformation server ) { // Create new var status = new ZappingStatus { Target = target, Services = s_NoServices }; // No state if (server == null) return status; // Attach to the first stream var streams = server.Streams; if (streams != null) if (streams.Count > 0) status.Source = SourceIdentifier.ToString( streams[0].Source ).Replace( " ", "" ); // Fill in NVOD services in the standard index order var services = server.Services; if (services != null) status.Services = services .Where( service => service != null ) .Select( ZappingService.Create ) .OrderBy( service => service.Index ) .ToArray(); // Report return status; }
/// <summary> /// Erstellt einen neuen Zustand. /// </summary> /// <param name="target">Das aktuelle Ziel des Datenversands.</param> /// <param name="server">Die zugehörigen Informationen des Aufzeichnungsprozesses.</param> /// <returns>Der gwünschte Zustand.</returns> public static ZappingStatus Create(string target, ServerInformation server) { // Create new var status = new ZappingStatus { Target = target, Services = s_NoServices }; // No state if (server == null) { return(status); } // Attach to the first stream var streams = server.Streams; if (streams != null) { if (streams.Count > 0) { status.Source = SourceIdentifier.ToString(streams[0].Source).Replace(" ", ""); } } // Fill in NVOD services in the standard index order var services = server.Services; if (services != null) { status.Services = services .Where(service => service != null) .Select(ZappingService.Create) .OrderBy(service => service.Index) .ToArray(); } // Report return(status); }