예제 #1
0
        /// <inheritdoc/>
        public override void Serialize(FRWriter writer)
        {
            ButtonBaseControl c = writer.DiffObject as ButtonBaseControl;

            base.Serialize(writer);

            if (AutoSize != c.AutoSize)
            {
                writer.WriteBool("AutoSize", AutoSize);
            }
            if (!writer.AreEqual(Image, c.Image))
            {
                writer.WriteValue("Image", Image);
            }
            if (ImageAlign != c.ImageAlign)
            {
                writer.WriteValue("ImageAlign", ImageAlign);
            }
            if (TextAlign != c.TextAlign)
            {
                writer.WriteValue("TextAlign", TextAlign);
            }
            if (TextImageRelation != c.TextImageRelation)
            {
                writer.WriteValue("TextImageRelation", TextImageRelation);
            }
        }
예제 #2
0
 internal void Serialize(FRWriter writer, ReportInfo c)
 {
     if (Name != c.Name)
     {
         writer.WriteStr("ReportInfo.Name", Name);
     }
     if (Author != c.Author)
     {
         writer.WriteStr("ReportInfo.Author", Author);
     }
     if (Version != c.Version)
     {
         writer.WriteStr("ReportInfo.Version", Version);
     }
     if (Description != c.Description)
     {
         writer.WriteStr("ReportInfo.Description", Description);
     }
     if (!writer.AreEqual(Picture, c.Picture))
     {
         writer.WriteValue("ReportInfo.Picture", Picture);
     }
     writer.WriteValue("ReportInfo.Created", Created);
     FModified = DateTime.Now;
     writer.WriteValue("ReportInfo.Modified", Modified);
     if (SavePreviewPicture != c.SavePreviewPicture)
     {
         writer.WriteBool("ReportInfo.SavePreviewPicture", SavePreviewPicture);
     }
     if (PreviewPictureRatio != c.PreviewPictureRatio)
     {
         writer.WriteFloat("ReportInfo.PreviewPictureRatio", PreviewPictureRatio);
     }
     writer.WriteStr("ReportInfo.CreatorVersion", CurrentVersion);
 }
예제 #3
0
 /// <summary>
 /// Serializes the watermark.
 /// </summary>
 /// <param name="writer">Writer object.</param>
 /// <param name="prefix">The watermark property name.</param>
 /// <param name="c">Another Watermark object to compare with.</param>
 /// <remarks>
 /// This method is for internal use only.
 /// </remarks>
 public void Serialize(FRWriter writer, string prefix, Watermark c)
 {
     if (Enabled != c.Enabled)
     {
         writer.WriteBool(prefix + ".Enabled", Enabled);
     }
     if (!writer.AreEqual(Image, c.Image))
     {
         writer.WriteValue(prefix + ".Image", Image);
     }
     if (ImageSize != c.ImageSize)
     {
         writer.WriteValue(prefix + ".ImageSize", ImageSize);
     }
     if (ImageTransparency != c.ImageTransparency)
     {
         writer.WriteFloat(prefix + ".ImageTransparency", ImageTransparency);
     }
     if (Text != c.Text)
     {
         writer.WriteStr(prefix + ".Text", Text);
     }
     if ((writer.SerializeTo != SerializeTo.Preview || !writer.AreEqual(Font, c.Font)) && writer.ItemName != "inherited")
     {
         writer.WriteValue(prefix + ".Font", Font);
     }
     TextFill.Serialize(writer, prefix + ".TextFill", c.TextFill);
     if (TextRotation != c.TextRotation)
     {
         writer.WriteValue(prefix + ".TextRotation", TextRotation);
     }
     if (ShowTextOnTop != c.ShowTextOnTop)
     {
         writer.WriteBool(prefix + ".ShowTextOnTop", ShowTextOnTop);
     }
     if (ShowImageOnTop != c.ShowImageOnTop)
     {
         writer.WriteBool(prefix + ".ShowImageOnTop", ShowImageOnTop);
     }
 }
예제 #4
0
        /// <inheritdoc/>
        public override void Serialize(FRWriter writer)
        {
            PictureBoxControl c = writer.DiffObject as PictureBoxControl;

            base.Serialize(writer);

            if (BorderStyle != c.BorderStyle)
            {
                writer.WriteValue("BorderStyle", BorderStyle);
            }
            if (!writer.AreEqual(Image, c.Image))
            {
                writer.WriteValue("Image", Image);
            }
            if (SizeMode != c.SizeMode)
            {
                writer.WriteValue("SizeMode", SizeMode);
            }
        }
예제 #5
0
        /// <inheritdoc/>
        public override void Serialize(FRWriter writer)
        {
            PictureObject c = writer.DiffObject as PictureObject;

            base.Serialize(writer);

#if PRINT_HOUSE
            writer.WriteStr("ImageLocation", ImageLocation);
#endif

            if (SizeMode != c.SizeMode)
            {
                writer.WriteValue("SizeMode", SizeMode);
            }
            if (FloatDiff(MaxWidth, c.MaxWidth))
            {
                writer.WriteFloat("MaxWidth", MaxWidth);
            }
            if (FloatDiff(MaxHeight, c.MaxHeight))
            {
                writer.WriteFloat("MaxHeight", MaxHeight);
            }
            if (Padding != c.Padding)
            {
                writer.WriteValue("Padding", Padding);
            }
            if (writer.SerializeTo != SerializeTo.Preview && writer.SerializeTo != SerializeTo.SourcePages &&
                ImageLocation != c.ImageLocation)
            {
                writer.WriteStr("ImageLocation", ImageLocation);
            }
            if (DataColumn != c.DataColumn)
            {
                writer.WriteStr("DataColumn", DataColumn);
            }
            if (TransparentColor != c.TransparentColor)
            {
                writer.WriteValue("TransparentColor", TransparentColor);
            }
            if (FloatDiff(Transparency, c.Transparency))
            {
                writer.WriteFloat("Transparency", Transparency);
            }
            if (ShowErrorImage != c.ShowErrorImage)
            {
                writer.WriteBool("ShowErrorImage", ShowErrorImage);
            }
            if (Tile != c.Tile)
            {
                writer.WriteBool("Tile", Tile);
            }
            if (Angle != c.Angle)
            {
                writer.WriteInt("Angle", Angle);
            }
            if (Grayscale != c.Grayscale)
            {
                writer.WriteBool("Grayscale", Grayscale);
            }
            // store image data
            if (writer.SerializeTo != SerializeTo.SourcePages)
            {
                if (writer.SerializeTo == SerializeTo.Preview ||
                    (String.IsNullOrEmpty(ImageLocation) && String.IsNullOrEmpty(DataColumn)))
                {
                    if (writer.BlobStore != null)
                    {
                        // check FImageIndex >= writer.BlobStore.Count is needed when we close the designer
                        // and run it again, the BlobStore is empty, but FImageIndex is pointing to
                        // previous BlobStore item and is not -1.
                        if (imageIndex == -1 || imageIndex >= writer.BlobStore.Count)
                        {
                            byte[] bytes = imageData;
                            if (bytes == null)
                            {
                                using (MemoryStream stream = new MemoryStream())
                                {
                                    ImageHelper.Save(Image, stream, ImageFormat.Png);
                                    bytes = stream.ToArray();
                                }
                            }
                            imageIndex = writer.BlobStore.Add(bytes);
                        }
                    }
                    else
                    {
                        if (Image == null && imageData != null)
                        {
                            writer.WriteStr("Image", Convert.ToBase64String(imageData));
                        }
                        else if (!writer.AreEqual(Image, c.Image))
                        {
                            writer.WriteValue("Image", Image);
                        }
                    }

                    if (writer.BlobStore != null || writer.SerializeTo == SerializeTo.Undo)
                    {
                        writer.WriteInt("ImageIndex", imageIndex);
                    }
                }
            }
        }
예제 #6
0
        /// <inheritdoc/>
        public override void Serialize(FRWriter writer, string prefix, FillBase fill)
        {
            base.Serialize(writer, prefix, fill);
            TextureFill c = fill as TextureFill;

            if (c == null || c.ImageWidth != ImageWidth)
            {
                writer.WriteValue(prefix + ".ImageWidth", ImageWidth);
            }
            if (c == null || c.ImageHeight != ImageHeight)
            {
                writer.WriteValue(prefix + ".ImageHeight", ImageHeight);
            }
            if (c == null || c.PreserveAspectRatio != PreserveAspectRatio)
            {
                writer.WriteBool(prefix + ".PreserveAspectRatio", PreserveAspectRatio);
            }
            if (c == null || c.WrapMode != WrapMode)
            {
                writer.WriteValue(prefix + ".WrapMode", WrapMode);
            }
            if (c == null || c.ImageOffsetX != ImageOffsetX)
            {
                writer.WriteValue(prefix + ".ImageOffsetX", ImageOffsetX);
            }
            if (c == null || c.ImageOffsetY != ImageOffsetY)
            {
                writer.WriteValue(prefix + ".ImageOffsetY", ImageOffsetY);
            }

            // store image data
            if (writer.SerializeTo != SerializeTo.SourcePages)
            {
                if (writer.BlobStore != null)
                {
                    // check FImageIndex >= writer.BlobStore.Count is needed when we close the designer
                    // and run it again, the BlobStore is empty, but FImageIndex is pointing to
                    // previous BlobStore item and is not -1.
                    if (imageIndex == -1 || imageIndex >= writer.BlobStore.Count)
                    {
                        byte[] bytes = imageData;
                        if (bytes == null)
                        {
                            using (MemoryStream stream = new MemoryStream())
                            {
                                ImageHelper.Save(image, stream, ImageFormat.Png);
                                bytes = stream.ToArray();
                            }
                        }
                        if (bytes != null)
                        {
                            string imgHash = BitConverter.ToString(new Murmur3().ComputeHash(bytes));
                            if (imgHash != dummyImageHash)
                            {
                                imageIndex = writer.BlobStore.AddOrUpdate(bytes, imgHash.Replace("-", String.Empty));
                            }
                        }
                    }
                }
                else
                {
                    if (imageData != null)
                    {
                        string hash = BitConverter.ToString(new Murmur3().ComputeHash(imageData));
                        if (hash != dummyImageHash)
                        {
                            if (c == null || !writer.AreEqual(ImageData, c.ImageData))
                            {
                                writer.WriteStr(prefix + ".ImageData", Convert.ToBase64String(ImageData));
                            }
                        }
                    }
                }

                if (writer.BlobStore != null || writer.SerializeTo == SerializeTo.Undo)
                {
                    writer.WriteInt(prefix + ".ImageIndex", imageIndex);
                }
            }
        }
예제 #7
0
        /// <inheritdoc/>
        public override void Serialize(FRWriter writer)
        {
            PictureObject c = writer.DiffObject as PictureObject;

            base.Serialize(writer);

#if PRINT_HOUSE
            writer.WriteStr("ImageLocation", ImageLocation);
#endif
            if (TransparentColor != c.TransparentColor)
            {
                writer.WriteValue("TransparentColor", TransparentColor);
            }
            if (FloatDiff(Transparency, c.Transparency))
            {
                writer.WriteFloat("Transparency", Transparency);
            }
            if (Tile != c.Tile)
            {
                writer.WriteBool("Tile", Tile);
            }
            // store image data
            if (writer.SerializeTo != SerializeTo.SourcePages)
            {
                if (writer.SerializeTo == SerializeTo.Preview ||
                    (String.IsNullOrEmpty(ImageLocation) && String.IsNullOrEmpty(DataColumn)))
                {
                    if (writer.BlobStore != null)
                    {
                        // check FImageIndex >= writer.BlobStore.Count is needed when we close the designer
                        // and run it again, the BlobStore is empty, but FImageIndex is pointing to
                        // previous BlobStore item and is not -1.
                        if (imageIndex == -1 || imageIndex >= writer.BlobStore.Count)
                        {
                            byte[] bytes = imageData;
                            if (bytes == null)
                            {
                                using (MemoryStream stream = new MemoryStream())
                                {
                                    ImageHelper.Save(Image, stream, ImageFormat.Png);
                                    bytes = stream.ToArray();
                                }
                            }
                            if (bytes != null)
                            {
                                string imgHash = BitConverter.ToString(new Murmur3().ComputeHash(bytes));
                                imageIndex = writer.BlobStore.AddOrUpdate(bytes, imgHash);
                            }
                        }
                    }
                    else
                    {
                        if (Image == null && imageData != null)
                        {
                            writer.WriteStr("Image", Convert.ToBase64String(imageData));
                        }
                        else if (!writer.AreEqual(Image, c.Image))
                        {
                            writer.WriteValue("Image", Image);
                        }
                    }

                    if (writer.BlobStore != null || writer.SerializeTo == SerializeTo.Undo)
                    {
                        writer.WriteInt("ImageIndex", imageIndex);
                    }
                }
            }
        }
예제 #8
0
 internal void Serialize(FRWriter writer, PrintSettings c)
 {
     if (SavePrinterWithReport && Printer != c.Printer)
     {
         writer.WriteStr("PrintSettings.Printer", Printer);
     }
     if (SavePrinterWithReport != c.SavePrinterWithReport)
     {
         writer.WriteBool("PrintSettings.SavePrinterWithReport", SavePrinterWithReport);
     }
     if (PrintToFile != c.PrintToFile)
     {
         writer.WriteBool("PrintSettings.PrintToFile", PrintToFile);
     }
     if (PrintToFileName != c.PrintToFileName)
     {
         writer.WriteStr("PrintSettings.PrintToFileName", PrintToFileName);
     }
     if (PageRange != c.PageRange)
     {
         writer.WriteValue("PrintSettings.PageRange", PageRange);
     }
     if (PageNumbers != c.PageNumbers)
     {
         writer.WriteStr("PrintSettings.PageNumbers", PageNumbers);
     }
     if (Copies != c.Copies)
     {
         writer.WriteInt("PrintSettings.Copies", Copies);
     }
     if (Collate != c.Collate)
     {
         writer.WriteBool("PrintSettings.Collate", Collate);
     }
     if (PrintPages != c.PrintPages)
     {
         writer.WriteValue("PrintSettings.PrintPages", PrintPages);
     }
     if (Reverse != c.Reverse)
     {
         writer.WriteBool("PrintSettings.Reverse", Reverse);
     }
     if (Duplex != c.Duplex)
     {
         writer.WriteValue("PrintSettings.Duplex", Duplex);
     }
     if (PaperSource != c.PaperSource)
     {
         writer.WriteInt("PrintSettings.PaperSource", PaperSource);
     }
     if (PrintMode != c.PrintMode)
     {
         writer.WriteValue("PrintSettings.PrintMode", PrintMode);
     }
     if (PrintOnSheetWidth != c.PrintOnSheetWidth)
     {
         writer.WriteFloat("PrintSettings.PrintOnSheetWidth", PrintOnSheetWidth);
     }
     if (PrintOnSheetHeight != c.PrintOnSheetHeight)
     {
         writer.WriteFloat("PrintSettings.PrintOnSheetHeight", PrintOnSheetHeight);
     }
     if (PrintOnSheetRawPaperSize != c.PrintOnSheetRawPaperSize)
     {
         writer.WriteInt("PrintSettings.PrintOnSheetRawPaperSize", PrintOnSheetRawPaperSize);
     }
     if (PagesOnSheet != c.PagesOnSheet)
     {
         writer.WriteValue("PrintSettings.PagesOnSheet", PagesOnSheet);
     }
     if (!writer.AreEqual(CopyNames, c.CopyNames))
     {
         writer.WriteValue("PrintSettings.CopyNames", CopyNames);
     }
     if (ShowDialog != c.ShowDialog)
     {
         writer.WriteBool("PrintSettings.ShowDialog", ShowDialog);
     }
 }