using FastReport.Utils;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Windows.Forms;

namespace FastReport.Export
{
    partial class ExportBase
    {
        #region Private Methods

        /// <summary>
        /// Does nothing
        /// </summary>
        /// <param name="int0"></param>
        partial void ShowPerformance(int int0);

        /// <summary>
        /// Gets a report page with OverlayBand if it is a Demo or Academic.
        /// </summary>
        /// <param name="page">The prepared report page</param>
        /// <returns>The prepared report page with OverlayBand.</returns>
        protected ReportPage GetOverlayPage(ReportPage page)
        {
            if (page != null)
            {
#if Demo
      OverlayBand band = new OverlayBand();
      band.Parent = page;
      band.Bounds = new RectangleF(0, -page.TopMargin * Units.Millimeters, 200, 20);
      TextObject text = new TextObject();
      text.Parent = band;
      text.Bounds = new RectangleF(0, 0, Units.Millimeters * 50, 20);
      text.Text = typeof(Double).Name[0].ToString() + typeof(Exception).Name[0].ToString() +
          typeof(Math).Name[0].ToString() + typeof(Object).Name[0].ToString() + " " +
          typeof(ValueType).Name[0].ToString() + typeof(Exception).Name[0].ToString() +
          typeof(Rectangle).Name[0].ToString() + typeof(ShapeKind).Name[0].ToString() +
          typeof(ICloneable).Name[0].ToString() + typeof(Object).Name[0].ToString() +
          typeof(NonSerializedAttribute).Name[0].ToString();
#endif

#if Academic
      OverlayBand band = new OverlayBand();
      band.Parent = page;
      band.Bounds = new RectangleF(0, -page.TopMargin * Units.Millimeters, 200, 20);
      TextObject text = new TextObject();
      text.Parent = band;
      text.Bounds = new RectangleF(0, 0, Units.Millimeters * 50, 20);
      text.Text = typeof(Array).Name[0].ToString() + typeof(Char).Name[0].ToString() +
          typeof(Array).Name[0].ToString() + typeof(DateTime).Name[0].ToString() +
          typeof(Enum).Name[0].ToString() + typeof(Math).Name[0].ToString() +
          typeof(IComparable).Name[0].ToString() + typeof(Char).Name[0].ToString() +
          " " +
          typeof(LineObject).Name[0].ToString() + typeof(IComparable).Name[0].ToString() +
          typeof(Char).Name[0].ToString() + typeof(Enum).Name[0].ToString() +
          typeof(Nullable).Name[0].ToString() + typeof(ShapeObject).Name[0].ToString() +
          typeof(Enum).Name[0].ToString(); 
#endif
            }
            return page;
        }

        private int GetPagesCount(List<int> pages)
        {
#if Demo
            return 5;
#else
            return pages.Count;
#endif
        }

#if Demo || Academic
        internal const bool HAVE_TO_WORK_WITH_OVERLAY = true;
#else
        internal const bool HAVE_TO_WORK_WITH_OVERLAY = false;
#endif

        #endregion Private Methods
    }
}