Exemplo n.º 1
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.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);
     }
 }
Exemplo n.º 2
0
        /// <inheritdoc/>
        public override void Serialize(FRWriter writer)
        {
            NumericUpDownControl c = writer.DiffObject as NumericUpDownControl;

            base.Serialize(writer);

            if (DecimalPlaces != c.DecimalPlaces)
            {
                writer.WriteInt("DecimalPlaces", DecimalPlaces);
            }
            if (Hexadecimal != c.Hexadecimal)
            {
                writer.WriteBool("Hexadecimal", Hexadecimal);
            }
            if (Increment != c.Increment)
            {
                writer.WriteFloat("Increment", Increment);
            }
            if (Maximum != c.Maximum)
            {
                writer.WriteValue("Maximum", Maximum);
            }
            if (Minimum != c.Minimum)
            {
                writer.WriteValue("Minimum", Minimum);
            }
            if (ThousandsSeparator != c.ThousandsSeparator)
            {
                writer.WriteBool("ThousandsSeparator", ThousandsSeparator);
            }
            if (Value != c.Value)
            {
                writer.WriteValue("Value", Value);
            }
            if (ValueChangedEvent != c.ValueChangedEvent)
            {
                writer.WriteStr("ValueChangedEvent", ValueChangedEvent);
            }
        }
Exemplo n.º 3
0
        /// <inheritdoc/>
        public override void Serialize(FRWriter writer)
        {
            Total c = writer.DiffObject as Total;

            base.Serialize(writer);

            if (TotalType != c.TotalType)
            {
                writer.WriteValue("TotalType", TotalType);
            }
            if (Expression != c.Expression)
            {
                writer.WriteStr("Expression", Expression);
            }
            if (Evaluator != c.Evaluator)
            {
                writer.WriteRef("Evaluator", Evaluator);
            }
            if (PrintOn != c.PrintOn)
            {
                writer.WriteRef("PrintOn", PrintOn);
            }
            if (ResetAfterPrint != c.ResetAfterPrint)
            {
                writer.WriteBool("ResetAfterPrint", ResetAfterPrint);
            }
            if (ResetOnReprint != c.ResetOnReprint)
            {
                writer.WriteBool("ResetOnReprint", ResetOnReprint);
            }
            if (EvaluateCondition != c.EvaluateCondition)
            {
                writer.WriteStr("EvaluateCondition", EvaluateCondition);
            }
            if (IncludeInvisibleRows != c.IncludeInvisibleRows)
            {
                writer.WriteBool("IncludeInvisibleRows", IncludeInvisibleRows);
            }
        }
Exemplo n.º 4
0
        /// <inheritdoc/>
        public override void Serialize(FRWriter writer)
        {
            RichObject c = writer.DiffObject as RichObject;

            base.Serialize(writer);

            if (ActualTextStart != c.ActualTextStart)
            {
                writer.WriteInt("ActualTextStart", ActualTextStart);
            }
            if (ActualTextLength != c.ActualTextLength)
            {
                writer.WriteInt("ActualTextLength", ActualTextLength);
            }
            if (writer.SerializeTo != SerializeTo.Preview)
            {
                if (DataColumn != c.DataColumn)
                {
                    writer.WriteStr("DataColumn", DataColumn);
                }
            }
        }
Exemplo n.º 5
0
        /// <inheritdoc/>
        public override void Serialize(FRWriter writer)
        {
            MSChartObject c = writer.DiffObject as MSChartObject;

            base.Serialize(writer);

            if (DataSource != null)
            {
                writer.WriteRef("DataSource", DataSource);
            }
            if (Filter != c.Filter)
            {
                writer.WriteStr("Filter", Filter);
            }
            if (AlignXValues != c.AlignXValues)
            {
                writer.WriteBool("AlignXValues", AlignXValues);
            }
            if (AutoSeriesColumn != c.AutoSeriesColumn)
            {
                writer.WriteStr("AutoSeriesColumn", AutoSeriesColumn);
            }
            if (AutoSeriesColor != c.AutoSeriesColor)
            {
                writer.WriteStr("AutoSeriesColor", AutoSeriesColor);
            }
            if (AutoSeriesSortOrder != c.AutoSeriesSortOrder)
            {
                writer.WriteValue("AutoSeriesSortOrder", AutoSeriesSortOrder);
            }

            using (MemoryStream stream = new MemoryStream())
            {
                FChart.Serializer.Content = SerializationContents.All;
                FChart.Serializer.Save(stream);
                stream.Position = 0;
                writer.WriteValue("ChartData", stream);
            }
        }
Exemplo n.º 6
0
        /// <inheritdoc/>
        public override void Serialize(FRWriter writer)
        {
            CheckBoxObject c = writer.DiffObject as CheckBoxObject;

            base.Serialize(writer);

            if (Checked != c.Checked)
            {
                writer.WriteBool("Checked", Checked);
            }
            if (CheckedSymbol != c.CheckedSymbol)
            {
                writer.WriteValue("CheckedSymbol", CheckedSymbol);
            }
            if (UncheckedSymbol != c.UncheckedSymbol)
            {
                writer.WriteValue("UncheckedSymbol", UncheckedSymbol);
            }
            if (CheckColor != c.CheckColor)
            {
                writer.WriteValue("CheckColor", CheckColor);
            }
            if (DataColumn != c.DataColumn)
            {
                writer.WriteStr("DataColumn", DataColumn);
            }
            if (Expression != c.Expression)
            {
                writer.WriteStr("Expression", Expression);
            }
            if (CheckWidthRatio != c.CheckWidthRatio)
            {
                writer.WriteFloat("CheckWidthRatio", CheckWidthRatio);
            }
            if (HideIfUnchecked != c.HideIfUnchecked)
            {
                writer.WriteBool("HideIfUnchecked", HideIfUnchecked);
            }
        }
Exemplo n.º 7
0
        /// <inheritdoc/>
        public override void Serialize(FRWriter writer)
        {
            writer.ItemName = ClassName;
            if (Name != "")
            {
                writer.WriteStr("Name", Name);
            }
            if (Restrictions != Restrictions.None)
            {
                writer.WriteValue("Restrictions", Restrictions);
            }
            if (!String.IsNullOrEmpty(ConnectionString))
            {
                writer.WriteStr("ConnectionString", Crypter.EncryptString(ConnectionString));
            }
            if (!String.IsNullOrEmpty(ConnectionStringExpression))
            {
                writer.WriteStr("ConnectionStringExpression", ConnectionStringExpression);
            }
            if (LoginPrompt)
            {
                writer.WriteBool("LoginPrompt", true);
            }
            if (CommandTimeout != 30)
            {
                writer.WriteInt("CommandTimeout", CommandTimeout);
            }

            if (writer.SaveChildren)
            {
                foreach (TableDataSource c in Tables)
                {
                    if (c.Enabled)
                    {
                        writer.Write(c);
                    }
                }
            }
        }
Exemplo n.º 8
0
        internal override void Serialize(FRWriter writer, string prefix, FormatBase format)
        {
            base.Serialize(writer, prefix, format);
            CurrencyFormat c = format as CurrencyFormat;

            if (c == null || UseLocale != c.UseLocale)
            {
                writer.WriteBool(prefix + "UseLocale", UseLocale);
            }
            if (c == null || DecimalDigits != c.DecimalDigits)
            {
                writer.WriteInt(prefix + "DecimalDigits", DecimalDigits);
            }

            if (!UseLocale)
            {
                if (c == null || DecimalSeparator != c.DecimalSeparator)
                {
                    writer.WriteStr(prefix + "DecimalSeparator", DecimalSeparator);
                }
                if (c == null || GroupSeparator != c.GroupSeparator)
                {
                    writer.WriteStr(prefix + "GroupSeparator", GroupSeparator);
                }
                if (c == null || CurrencySymbol != c.CurrencySymbol)
                {
                    writer.WriteStr(prefix + "CurrencySymbol", CurrencySymbol);
                }
                if (c == null || PositivePattern != c.PositivePattern)
                {
                    writer.WriteInt(prefix + "PositivePattern", PositivePattern);
                }
                if (c == null || NegativePattern != c.NegativePattern)
                {
                    writer.WriteInt(prefix + "NegativePattern", NegativePattern);
                }
            }
        }
Exemplo n.º 9
0
        /// <inheritdoc/>
        public override void Serialize(FRWriter writer)
        {
            TableRow c = writer.DiffObject as TableRow;

            serializingToPreview = writer.SerializeTo == SerializeTo.Preview;
            base.Serialize(writer);

            if (FloatDiff(MinHeight, c.MinHeight))
            {
                writer.WriteFloat("MinHeight", MinHeight);
            }
            if (FloatDiff(MaxHeight, c.MaxHeight))
            {
                writer.WriteFloat("MaxHeight", MaxHeight);
            }
            if (FloatDiff(Height, c.Height))
            {
                writer.WriteFloat("Height", Height);
            }
            if (AutoSize != c.AutoSize)
            {
                writer.WriteBool("AutoSize", AutoSize);
            }

            if (Parent is TableResult)
            {
                // write children by itself
                SetFlags(Flags.CanWriteChildren, true);
                writer.SaveChildren = true;

                TableResult table = Parent as TableResult;
                foreach (TableColumn column in table.ColumnsToSerialize)
                {
                    TableCell cell = this[column.Index];
                    writer.Write(cell);
                }
            }
        }
Exemplo n.º 10
0
 internal void Serialize(FRWriter writer, Hyperlink hyperlink)
 {
     if (Kind != hyperlink.Kind)
     {
         writer.WriteValue("Hyperlink.Kind", Kind);
     }
     if (Expression != hyperlink.Expression)
     {
         writer.WriteStr("Hyperlink.Expression", Expression);
     }
     if (Value != hyperlink.Value)
     {
         writer.WriteStr("Hyperlink.Value", Value);
     }
     if (DetailReportName != hyperlink.DetailReportName)
     {
         // when saving to the report file, convert absolute path to the external report to relative path
         // (based on the main report path).
         string value = DetailReportName;
         if (writer.SerializeTo == SerializeTo.Report && Report != null && !String.IsNullOrEmpty(Report.FileName))
         {
             value = FileUtils.GetRelativePath(DetailReportName, Path.GetDirectoryName(Report.FileName));
         }
         writer.WriteStr("Hyperlink.DetailReportName", value);
     }
     if (DetailPageName != hyperlink.DetailPageName)
     {
         writer.WriteStr("Hyperlink.DetailPageName", DetailPageName);
     }
     if (ReportParameter != hyperlink.ReportParameter)
     {
         writer.WriteStr("Hyperlink.ReportParameter", ReportParameter);
     }
     if (ValuesSeparator != hyperlink.ValuesSeparator)
     {
         writer.WriteStr("Hyperlink.ValuesSeparator", ValuesSeparator);
     }
 }
Exemplo n.º 11
0
        /// <inheritdoc/>
        public override void Serialize(FRWriter writer)
        {
            CommandParameter c = writer.DiffObject as CommandParameter;

            base.Serialize(writer);

            if (DataType != c.DataType)
            {
                writer.WriteInt("DataType", DataType);
            }
            if (Size != c.Size)
            {
                writer.WriteInt("Size", Size);
            }
            if (Expression != c.Expression)
            {
                writer.WriteStr("Expression", Expression);
            }
            if (DefaultValue != c.DefaultValue)
            {
                writer.WriteStr("DefaultValue", DefaultValue);
            }
        }
Exemplo n.º 12
0
        /// <inheritdoc/>
        public override void Serialize(FRWriter writer)
        {
            TableColumn c = writer.DiffObject as TableColumn;

            base.Serialize(writer);

            if (FloatDiff(MinWidth, c.MinWidth))
            {
                writer.WriteFloat("MinWidth", MinWidth);
            }
            if (FloatDiff(MaxWidth, c.MaxWidth))
            {
                writer.WriteFloat("MaxWidth", MaxWidth);
            }
            if (FloatDiff(Width, c.Width))
            {
                writer.WriteFloat("Width", Width);
            }
            if (AutoSize != c.AutoSize)
            {
                writer.WriteBool("AutoSize", AutoSize);
            }
        }
Exemplo n.º 13
0
 /// <summary>
 /// Serializes the TextOutline.
 /// </summary>
 /// <param name="writer">Writer object.</param>
 /// <param name="prefix">TextOutline property name.</param>
 /// <param name="diff">Another TextOutline to compare with.</param>
 public void Serialize(FRWriter writer, string prefix, TextOutline diff)
 {
     if (enabled != diff.Enabled)
     {
         writer.WriteBool(prefix + ".Enabled", enabled);
     }
     if (color != diff.Color)
     {
         writer.WriteValue(prefix + ".Color", color);
     }
     if (width != diff.Width)
     {
         writer.WriteFloat(prefix + ".Width", width);
     }
     if (style != diff.Style)
     {
         writer.WriteValue(prefix + ".Style", style);
     }
     if (drawbehind != diff.DrawBehind)
     {
         writer.WriteBool(prefix + ".DrawBehind", drawbehind);
     }
 }
Exemplo n.º 14
0
        /// <inheritdoc/>
        public override void Serialize(FRWriter writer)
        {
            ListViewControl c = writer.DiffObject as ListViewControl;

            base.Serialize(writer);

            if (CheckBoxes != c.CheckBoxes)
            {
                writer.WriteBool("CheckBoxes", CheckBoxes);
            }
            if (MultiSelect != c.MultiSelect)
            {
                writer.WriteBool("MultiSelect", MultiSelect);
            }
            if (ShowGroups != c.ShowGroups)
            {
                writer.WriteBool("ShowGroups", ShowGroups);
            }
            if (View != c.View)
            {
                writer.WriteValue("View", View);
            }
        }
Exemplo n.º 15
0
        /// <inheritdoc/>
        public override void Serialize(FRWriter writer)
        {
            CellularTextObject c = writer.DiffObject as CellularTextObject;

            base.Serialize(writer);

            if (FloatDiff(CellWidth, c.CellWidth))
            {
                writer.WriteFloat("CellWidth", CellWidth);
            }
            if (FloatDiff(CellHeight, c.CellHeight))
            {
                writer.WriteFloat("CellHeight", CellHeight);
            }
            if (FloatDiff(HorzSpacing, c.HorzSpacing))
            {
                writer.WriteFloat("HorzSpacing", HorzSpacing);
            }
            if (FloatDiff(VertSpacing, c.VertSpacing))
            {
                writer.WriteFloat("VertSpacing", VertSpacing);
            }
        }
Exemplo n.º 16
0
        /// <inheritdoc/>
        public override void Serialize(FRWriter writer)
        {
            Border.SimpleBorder = true;
            base.Serialize(writer);
            PolyLineObject c = writer.DiffObject as PolyLineObject;

            StringBuilder sb = new StringBuilder(points.Count * 10);

            for (int i = 0; i < points.Count; i++)
            {
                sb.AppendFormat("{0}\\{1}\\{2}", points[i].X.ToString(CultureInfo.InvariantCulture),
                                points[i].Y.ToString(CultureInfo.InvariantCulture),
                                pointTypes[i]);
                if (i < points.Count - 1)
                {
                    sb.Append("|");
                }
            }

            writer.WriteStr("PolyPoints", sb.ToString());

            writer.WriteFloat("CenterX", center.X);
            writer.WriteFloat("CenterY", center.Y);
        }
Exemplo n.º 17
0
        /// <inheritdoc/>
        public override void Serialize(FRWriter writer)
        {
            ComponentBase c = writer.DiffObject as ComponentBase;
            base.Serialize(writer);

            if (Printable != c.Printable)
                writer.WriteBool("Printable", Printable);
            if (PrintableExpression != c.PrintableExpression)
                writer.WriteStr("PrintableExpression", PrintableExpression);
            if (HasFlag(Flags.CanWriteBounds))
            {
                if (FloatDiff(Left, c.Left))
                    writer.WriteFloat("Left", Left);
                if (FloatDiff(Top, c.Top))
                    writer.WriteFloat("Top", Top);
                if (FloatDiff(Width, c.Width))
                    writer.WriteFloat("Width", Width);
                if (FloatDiff(Height, c.Height))
                    writer.WriteFloat("Height", Height);
            }
            if (writer.SerializeTo != SerializeTo.Preview)
            {
                if (Dock != c.Dock)
                    writer.WriteValue("Dock", Dock);
                if (Anchor != c.Anchor)
                    writer.WriteValue("Anchor", Anchor);
                if (Visible != c.Visible)
                    writer.WriteBool("Visible", Visible);
                if (VisibleExpression != c.VisibleExpression)
                    writer.WriteStr("VisibleExpression", VisibleExpression);
                if (GroupIndex != c.GroupIndex)
                    writer.WriteInt("GroupIndex", GroupIndex);
            }
            if (Tag != c.Tag)
                writer.WriteStr("Tag", Tag);
        }
Exemplo n.º 18
0
        /// <inheritdoc/>
        public override void Serialize(FRWriter writer)
        {
            Border.SimpleBorder = true;
            base.Serialize(writer);
            PolyLineObject c = writer.DiffObject as PolyLineObject;

            StringBuilder sb = new StringBuilder(pointsCollection.Count * 10);

            foreach (PolyPoint point in pointsCollection)
            {
                point.Serialize(sb);
                sb.Append("|");
            }

            if (sb.Length > 0)
            {
                sb.Length--;
            }

            writer.WriteStr("PolyPoints_v2", sb.ToString());

            writer.WriteFloat("CenterX", center.X);
            writer.WriteFloat("CenterY", center.Y);
        }
Exemplo n.º 19
0
        /// <inheritdoc/>
        public override void Serialize(FRWriter writer)
        {
            MSChartSeries s = writer.DiffObject as MSChartSeries;

            base.Serialize(writer);

            if (Filter != s.Filter)
            {
                writer.WriteStr("Filter", Filter);
            }
            if (SortOrder != s.SortOrder)
            {
                writer.WriteValue("SortOrder", SortOrder);
            }
            if (SortBy != s.SortBy)
            {
                writer.WriteValue("SortBy", SortBy);
            }
            if (GroupBy != s.GroupBy)
            {
                writer.WriteValue("GroupBy", GroupBy);
            }
            if (GroupInterval != s.GroupInterval)
            {
                writer.WriteFloat("GroupInterval", GroupInterval);
            }
            if (GroupFunction != s.GroupFunction)
            {
                writer.WriteValue("GroupFunction", GroupFunction);
            }
            if (Collect != s.Collect)
            {
                writer.WriteValue("Collect", Collect);
            }
            if (CollectValue != s.CollectValue)
            {
                writer.WriteFloat("CollectValue", CollectValue);
            }
            if (CollectedItemText != s.CollectedItemText)
            {
                writer.WriteStr("CollectedItemText", CollectedItemText);
            }
            if (CollectedItemColor != s.CollectedItemColor)
            {
                writer.WriteValue("CollectedItemColor", CollectedItemColor);
            }
            if (PieExplode != s.PieExplode)
            {
                writer.WriteValue("PieExplode", PieExplode);
            }
            if (PieExplodeValue != s.PieExplodeValue)
            {
                writer.WriteStr("PieExplodeValue", PieExplodeValue);
            }

            if (XValue != s.XValue)
            {
                writer.WriteStr("XValue", XValue);
            }
            if (YValue1 != s.YValue1)
            {
                writer.WriteStr("YValue1", YValue1);
            }
            if (YValue2 != s.YValue2)
            {
                writer.WriteStr("YValue2", YValue2);
            }
            if (YValue3 != s.YValue3)
            {
                writer.WriteStr("YValue3", YValue3);
            }
            if (YValue4 != s.YValue4)
            {
                writer.WriteStr("YValue4", YValue4);
            }
            if (Color != s.Color)
            {
                writer.WriteStr("Color", Color);
            }
        }
Exemplo n.º 20
0
 /// <inheritdoc/>
 public override void Serialize(FRWriter writer, string prefix, GaugePointer diff)
 {
     base.Serialize(writer, prefix, diff);
 }
Exemplo n.º 21
0
        /// <inheritdoc/>
        public override void Serialize(FRWriter writer)
        {
            if (writer.SerializeTo != SerializeTo.SourcePages)
            {
                writer.Write(Data.Columns);
                writer.Write(Data.Rows);
                writer.Write(Data.Cells);
            }
            else
            {
                RefreshTemplate(true);
            }

            base.Serialize(writer);
            MatrixObject c = writer.DiffObject as MatrixObject;

            if (AutoSize != c.AutoSize)
            {
                writer.WriteBool("AutoSize", AutoSize);
            }
            if (CellsSideBySide != c.CellsSideBySide)
            {
                writer.WriteBool("CellsSideBySide", CellsSideBySide);
            }
            if (KeepCellsSideBySide != c.KeepCellsSideBySide)
            {
                writer.WriteBool("KeepCellsSideBySide", KeepCellsSideBySide);
            }
            if (DataSource != c.DataSource)
            {
                writer.WriteRef("DataSource", DataSource);
            }
            if (Filter != c.Filter)
            {
                writer.WriteStr("Filter", Filter);
            }
            if (ShowTitle != c.ShowTitle)
            {
                writer.WriteBool("ShowTitle", ShowTitle);
            }
            if (Style != c.Style)
            {
                writer.WriteStr("Style", Style);
            }
            if (MatrixEvenStylePriority != c.MatrixEvenStylePriority)
            {
                writer.WriteValue("MatrixEvenStylePriority", MatrixEvenStylePriority);
            }
            if (SplitRows != c.SplitRows)
            {
                writer.WriteValue("SplitRows", SplitRows);
            }
            if (ManualBuildEvent != c.ManualBuildEvent)
            {
                writer.WriteStr("ManualBuildEvent", ManualBuildEvent);
            }
            if (ModifyResultEvent != c.ModifyResultEvent)
            {
                writer.WriteStr("ModifyResultEvent", ModifyResultEvent);
            }
            if (AfterTotalsEvent != c.AfterTotalsEvent)
            {
                writer.WriteStr("AfterTotalsEvent", AfterTotalsEvent);
            }
        }
Exemplo n.º 22
0
 /// <inheritdoc/>
 public void Serialize(FRWriter writer)
 {
     writer.ItemName = GetType().Name;
     Serialize(writer, "", writer.DiffObject as FormatBase);
 }
Exemplo n.º 23
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);
                }
            }
        }
Exemplo n.º 24
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);
                    }
                }
            }
        }
Exemplo n.º 25
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);
                    }
                }
            }
        }
Exemplo n.º 26
0
        /// <inheritdoc/>
        public override void Serialize(FRWriter writer)
        {
            ReportComponentBase c = writer.DiffObject as ReportComponentBase;

            base.Serialize(writer);

            if (Exportable != c.Exportable)
            {
                writer.WriteBool("Exportable", Exportable);
            }
            Border.Serialize(writer, "Border", c.Border);
            //if(Fill != c.Fill)
            Fill.Serialize(writer, "Fill", c.Fill);
            if (Cursor != c.Cursor && !Config.WebMode)
            {
                writer.WriteValue("Cursor", Cursor);
            }
            Hyperlink.Serialize(writer, c.Hyperlink);
            if (Bookmark != c.Bookmark)
            {
                writer.WriteStr("Bookmark", Bookmark);
            }
            if (writer.SerializeTo != SerializeTo.Preview)
            {
                if (CanGrow != c.CanGrow)
                {
                    writer.WriteBool("CanGrow", CanGrow);
                }
                if (CanShrink != c.CanShrink)
                {
                    writer.WriteBool("CanShrink", CanShrink);
                }
                if (GrowToBottom != c.GrowToBottom)
                {
                    writer.WriteBool("GrowToBottom", GrowToBottom);
                }
                if (ShiftMode != c.ShiftMode)
                {
                    writer.WriteValue("ShiftMode", ShiftMode);
                }
                if (FlagSerializeStyle && Style != c.Style)
                {
                    writer.WriteStr("Style", Style);
                }
                if (EvenStyle != c.EvenStyle)
                {
                    writer.WriteStr("EvenStyle", EvenStyle);
                }
                if (EvenStylePriority != c.EvenStylePriority)
                {
                    writer.WriteValue("EvenStylePriority", EvenStylePriority);
                }
                if (HoverStyle != c.HoverStyle)
                {
                    writer.WriteStr("HoverStyle", HoverStyle);
                }
                if (PrintOn != c.PrintOn)
                {
                    writer.WriteValue("PrintOn", PrintOn);
                }
                if (BeforePrintEvent != c.BeforePrintEvent)
                {
                    writer.WriteStr("BeforePrintEvent", BeforePrintEvent);
                }
                if (AfterPrintEvent != c.AfterPrintEvent)
                {
                    writer.WriteStr("AfterPrintEvent", AfterPrintEvent);
                }
                if (AfterDataEvent != c.AfterDataEvent)
                {
                    writer.WriteStr("AfterDataEvent", AfterDataEvent);
                }
                if (ClickEvent != c.ClickEvent)
                {
                    writer.WriteStr("ClickEvent", ClickEvent);
                }
                if (MouseMoveEvent != c.MouseMoveEvent)
                {
                    writer.WriteStr("MouseMoveEvent", MouseMoveEvent);
                }
                if (MouseUpEvent != c.MouseUpEvent)
                {
                    writer.WriteStr("MouseUpEvent", MouseUpEvent);
                }
                if (MouseDownEvent != c.MouseDownEvent)
                {
                    writer.WriteStr("MouseDownEvent", MouseDownEvent);
                }
                if (MouseEnterEvent != c.MouseEnterEvent)
                {
                    writer.WriteStr("MouseEnterEvent", MouseEnterEvent);
                }
                if (MouseLeaveEvent != c.MouseLeaveEvent)
                {
                    writer.WriteStr("MouseLeaveEvent", MouseLeaveEvent);
                }
            }
        }
Exemplo n.º 27
0
        /// <inheritdoc/>
        public override void Serialize(FRWriter writer)
        {
            ReportPage c = writer.DiffObject as ReportPage;

            base.Serialize(writer);
            if (ExportAlias != c.ExportAlias)
            {
                writer.WriteStr("ExportAlias", ExportAlias);
            }
            if (Landscape != c.Landscape)
            {
                writer.WriteBool("Landscape", Landscape);
            }
            if (FloatDiff(PaperWidth, c.PaperWidth))
            {
                writer.WriteFloat("PaperWidth", PaperWidth);
            }
            if (FloatDiff(PaperHeight, c.PaperHeight))
            {
                writer.WriteFloat("PaperHeight", PaperHeight);
            }
            if (RawPaperSize != c.RawPaperSize)
            {
                writer.WriteInt("RawPaperSize", RawPaperSize);
            }
            if (FloatDiff(LeftMargin, c.LeftMargin))
            {
                writer.WriteFloat("LeftMargin", LeftMargin);
            }
            if (FloatDiff(TopMargin, c.TopMargin))
            {
                writer.WriteFloat("TopMargin", TopMargin);
            }
            if (FloatDiff(RightMargin, c.RightMargin))
            {
                writer.WriteFloat("RightMargin", RightMargin);
            }
            if (FloatDiff(BottomMargin, c.BottomMargin))
            {
                writer.WriteFloat("BottomMargin", BottomMargin);
            }
            if (MirrorMargins != c.MirrorMargins)
            {
                writer.WriteBool("MirrorMargins", MirrorMargins);
            }
            WritePreview(writer, c);
            Columns.Serialize(writer, c.Columns);
            if (Guides.Count > 0)
            {
                writer.WriteValue("Guides", Guides);
            }
            Border.Serialize(writer, "Border", c.Border);
            Fill.Serialize(writer, "Fill", c.Fill);
            Watermark.Serialize(writer, "Watermark", c.Watermark);
            if (TitleBeforeHeader != c.TitleBeforeHeader)
            {
                writer.WriteBool("TitleBeforeHeader", TitleBeforeHeader);
            }
            if (OutlineExpression != c.OutlineExpression)
            {
                writer.WriteStr("OutlineExpression", OutlineExpression);
            }
            if (PrintOnPreviousPage != c.PrintOnPreviousPage)
            {
                writer.WriteBool("PrintOnPreviousPage", PrintOnPreviousPage);
            }
            if (ResetPageNumber != c.ResetPageNumber)
            {
                writer.WriteBool("ResetPageNumber", ResetPageNumber);
            }
            if (ExtraDesignWidth != c.ExtraDesignWidth)
            {
                writer.WriteBool("ExtraDesignWidth", ExtraDesignWidth);
            }
            if (StartOnOddPage != c.StartOnOddPage)
            {
                writer.WriteBool("StartOnOddPage", StartOnOddPage);
            }
            if (BackPage != c.BackPage)
            {
                writer.WriteBool("BackPage", BackPage);
            }
            if (StartPageEvent != c.StartPageEvent)
            {
                writer.WriteStr("StartPageEvent", StartPageEvent);
            }
            if (FinishPageEvent != c.FinishPageEvent)
            {
                writer.WriteStr("FinishPageEvent", FinishPageEvent);
            }
            if (ManualBuildEvent != c.ManualBuildEvent)
            {
                writer.WriteStr("ManualBuildEvent", ManualBuildEvent);
            }
            if (UnlimitedHeight != c.UnlimitedHeight)
            {
                writer.WriteBool("UnlimitedHeight", UnlimitedHeight);
            }
            if (PrintOnRollPaper != c.PrintOnRollPaper)
            {
                writer.WriteBool("PrintOnRollPaper", PrintOnRollPaper);
            }
            if (UnlimitedWidth != c.UnlimitedWidth)
            {
                writer.WriteBool("UnlimitedWidth", UnlimitedWidth);
            }
            if (FloatDiff(UnlimitedHeightValue, c.UnlimitedHeightValue))
            {
                writer.WriteFloat("UnlimitedHeightValue", UnlimitedHeightValue);
            }
            if (FloatDiff(UnlimitedWidthValue, c.UnlimitedWidthValue))
            {
                writer.WriteFloat("UnlimitedWidthValue", UnlimitedWidthValue);
            }
        }
Exemplo n.º 28
0
 /// <summary>
 /// Does nothing
 /// </summary>
 /// <param name="writer"></param>
 /// <param name="reportPage"></param>
 partial void WritePreview(FRWriter writer, ReportPage reportPage);
Exemplo n.º 29
0
 /// <inheritdoc/>
 public override void Serialize(FRWriter writer)
 {
     writer.WriteValue("PageRange", PageRange);
     writer.WriteStr("PageNumbers", PageNumbers);
     writer.WriteBool("OpenAfterExport", OpenAfterExport);
 }
Exemplo n.º 30
0
 /// <summary>
 /// Does nothing
 /// </summary>
 /// <param name="writer"></param>
 /// <param name="report"></param>
 private void SerializeDesign(FRWriter writer, Report report)
 {
 }