/// <summary> /// Gets a list of source files used to create this PAR2 file. /// </summary> /// <returns>A collection of <see cref="SourceFile"/> objects.</returns> public IEnumerable<SourceFile> GetSourceList() { var yieldedFiles = new List<FileID>(); using (var reader = new ParReader(StreamFactory.GetContentStreamAsync(Location).Result)) { while (reader.BaseStream.Position < reader.BaseStream.Length) { var fd = reader.ReadPacket(Packet.DefaultFactory.GetPacketType<FileDescriptionPacket>()) as FileDescriptionPacket; if (fd == null) break; if (yieldedFiles.Contains(fd.FileID)) continue; yield return fd.ToSourceFile(); } } }
/// <summary> /// Gets a list of source files used to create this PAR2 file. /// </summary> /// <returns>A collection of <see cref="SourceFile"/> objects.</returns> public IEnumerable <SourceFile> GetSourceList() { var yieldedFiles = new List <FileID>(); using (var reader = new ParReader(StreamFactory.GetContentStreamAsync(Location).Result)) { while (reader.BaseStream.Position < reader.BaseStream.Length) { var fd = reader.ReadPacket(Packet.DefaultFactory.GetPacketType <FileDescriptionPacket>()) as FileDescriptionPacket; if (fd == null) { break; } if (yieldedFiles.Contains(fd.FileID)) { continue; } yield return(fd.ToSourceFile()); } } }