12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- using System.Windows.Forms;
- using FastReport.Forms;
- using FastReport.Utils;
- namespace FastReport
- {
- partial class DataBand : IHasEditor
- {
- #region Private Methods
- private bool ShouldSerializeColumns()
- {
- return Columns.Count > 1;
- }
- #endregion
- #region Public Methods
- /// <inheritdoc/>
- public override void Delete()
- {
- if (!CanDelete)
- return;
- // remove only this band, keep its subbands
- if (Parent is ReportPage || Parent is DataBand)
- {
- Base parent = Parent;
- int zOrder = ZOrder;
- Parent = null;
- while (Bands.Count > 0)
- {
- BandBase band = Bands[Bands.Count - 1];
- band.Parent = parent;
- band.ZOrder = zOrder;
- }
- Dispose();
- }
- }
- /// <inheritdoc/>
- public override SmartTagBase GetSmartTag()
- {
- return new DataBandSmartTag(this);
- }
- /// <inheritdoc/>
- public override ContextMenuBase GetContextMenu()
- {
- return new DataBandMenu(Report.Designer);
- }
- internal override string GetInfoText()
- {
- return DataSource == null ? "" : DataSource.FullName;
- }
- /// <inheritdoc/>
- public bool InvokeEditor()
- {
- using (DataBandEditorForm form = new DataBandEditorForm(this))
- {
- return form.ShowDialog() == DialogResult.OK;
- }
- }
- /// <summary>
- /// Invokes column editor
- /// </summary>
- public bool InvokeColumnsEditor()
- {
- using (DataBandColumnEditorForm form = new DataBandColumnEditorForm(this.Columns))
- {
- return form.ShowDialog() == DialogResult.OK;
- }
- }
- #endregion
- }
- }
|