Ejemplo n.º 1
0
        public override void WriteBodyTo(ShockwaveWriter output)
        {
            output.WriteBigEndian(CompressionTypeId);
            output.WriteBigEndian(ImageQuality);
            output.WriteBigEndian(ImageTypes);
            output.WriteBigEndian(DirTypes);
            output.WriteBigEndian(CompressionLevel);
            output.WriteBigEndian(Speed);

            if (CompressionTypeId == 256)
            {
                output.WriteNullString(Name);
            }
        }
Ejemplo n.º 2
0
        public override void WriteBodyTo(ShockwaveWriter output)
        {
            throw new NotImplementedException(nameof(FileCompressionTypesChunk));
            //TODO: Compressor
            output.Write(CompressionTypeId);
            output.Write(ImageQuality);
            output.Write(ImageTypes);
            output.Write(DirTypes);
            output.Write(CompressionLevel);
            output.Write(Speed);

            if (CompressionTypeId == 256)
            {
                output.WriteNullString(Name);
            }
        }
Ejemplo n.º 3
0
        private void WriteProperty(ShockwaveWriter output, int index, ref int endOffset)
        {
            //TODO: Better checks & possibly "compression"?
            switch (index)
            {
            case 0 when !string.IsNullOrEmpty(ScriptText):
                output.Write(ScriptText);
                endOffset += ScriptText.Length;
                break;

            case 1 when !string.IsNullOrEmpty(Name):
                output.Write(Name);
                endOffset += Name.Length + 1;
                break;

            case 2 when !string.IsNullOrEmpty(FilePath):
                output.Write(FilePath);
                endOffset += FilePath.Length;
                break;

            case 3 when !string.IsNullOrEmpty(FileName):
                output.Write(FileName);
                endOffset += FileName.Length;
                break;

            case 4 when !string.IsNullOrEmpty(FileType):
                output.Write(FileType);
                endOffset += FileType.Length;
                break;

            case 9 when XtraGUID != null:
                output.Write(XtraGUID.ToByteArray());
                //output.Write<T>()
                endOffset += 16;
                break;

            case 10 when !string.IsNullOrEmpty(XtraName):
                output.WriteNullString(XtraName);
                endOffset += XtraName.Length + 1;
                break;

            case 12 when RegistrationPoints != null:
                for (int i = 0; i < RegistrationPoints.Length; i++)
                {
                    output.Write(RegistrationPoints[i]);
                }
                endOffset += RegistrationPoints.Length * sizeof(int);
                break;

            case 16 when !string.IsNullOrEmpty(ClipboardFormat):
                output.Write(ClipboardFormat);
                endOffset += ClipboardFormat.Length;
                break;

            case 17 when CreationDate != 0:
                output.Write(CreationDate / 1000);
                endOffset += sizeof(int);
                break;

            case 18 when ModifiedDate != 0:
                output.Write(ModifiedDate / 1000);
                endOffset += sizeof(int);
                break;

            case 19 when !string.IsNullOrEmpty(ModifiedBy):
                output.WriteNullString(ModifiedBy);
                endOffset += ModifiedBy.Length + 1;     //TODO:
                break;

            case 20 when !string.IsNullOrEmpty(Comments):
                output.Write(Comments);
                endOffset += Comments.Length;
                break;

            case 21 when ImageCompression != 0 || ImageQuality != 0:
                output.Write((byte)(ImageCompression << 4));
                output.Write((byte)ImageQuality);
                output.Write((byte)0);
                output.Write((byte)0);
                endOffset += 4;
                break;

            default:
                break;
            }
        }