private static PlgxEmbeddedFile ReadEmbeddedFileFromPlgxData(FilePlgxObject plgxFileObject) { PlgxEmbeddedFile plgxFile = new PlgxEmbeddedFile(); using (FilePlgxObjectReader reader = new FilePlgxObjectReader(plgxFileObject)) { PlgxObject nextObject; while ((nextObject = reader.ReadNextObject()) != null) { if (nextObject is FilePathPlgxObject) { plgxFile.Path = ((FilePathPlgxObject)nextObject).FilePath; } else { // Unrecognised plgx object type. Nothing to do. } } return(plgxFile); } }
public FilePlgxObjectReader(FilePlgxObject fileObject) : base() { this.memoryStream = new MemoryStream(fileObject.Data); this.BinaryReader = new BinaryReader(this.memoryStream); }