Esempio n. 1
0
        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);
            }
        }
Esempio n. 2
0
 public FilePlgxObjectReader(FilePlgxObject fileObject) : base()
 {
     this.memoryStream = new MemoryStream(fileObject.Data);
     this.BinaryReader = new BinaryReader(this.memoryStream);
 }