using System; using System.Collections.Generic; using System.Text; using System.ComponentModel; using FastReport.Utils; namespace FastReport { /// /// Base class for headers and footers which support the "Keep With Data" and "Repeat on Every Page" features. /// public partial class HeaderFooterBandBase : BandBase { #region Fields private bool keepWithData; private bool repeatOnEveryPage; #endregion #region Properties /// /// Gets or sets a value indicating that the band should be printed together with data band. /// [DefaultValue(false)] [Category("Behavior")] public bool KeepWithData { get { return keepWithData; } set { keepWithData = value; } } /// /// Gets or sets a value that determines whether to repeat this band on every page. /// /// /// When band is repeated, its property is set to true. You can use /// it to show any additional information on the band. To do this, /// use the property which /// can be set to "Rpeeated". In that case the object will be printed /// only on the repeated band. /// [DefaultValue(false)] [Category("Behavior")] public bool RepeatOnEveryPage { get { return repeatOnEveryPage; } set { repeatOnEveryPage = value; } } #endregion #region Public Methods /// public override void Assign(Base source) { base.Assign(source); HeaderFooterBandBase src = source as HeaderFooterBandBase; KeepWithData = src.KeepWithData; RepeatOnEveryPage = src.RepeatOnEveryPage; } /// public override void Serialize(FRWriter writer) { HeaderFooterBandBase c = writer.DiffObject as HeaderFooterBandBase; base.Serialize(writer); if (KeepWithData != c.KeepWithData) writer.WriteBool("KeepWithData", KeepWithData); if (RepeatOnEveryPage != c.RepeatOnEveryPage) writer.WriteBool("RepeatOnEveryPage", RepeatOnEveryPage); } #endregion } }