Exemple #1
0
        /// <summary>
        /// Creates a new calendar home page/main wizard.
        /// </summary>
        public static IWizardNavigator CreateHomePageWizard(CalendarDesigner designer)
        {
            IServiceProvider provider = designer.ReportItem.Site;
            IWizardNavigator group    = WizardStep.CreateaWizardNavigator(null, null, provider);

            group.Steps.Add(new WizardStep(group, new CalendarGeneralPage(designer),
                                           Resources.CalendarSmartPanelGeneralPageTitle, Resources.CalendarSmartPanelGeneralTitle,
                                           Resources.General_16));
            group.Steps.Add(new WizardStep(group, new CalendarDataPage(designer),
                                           Resources.CalendarSmartPanelDataPageTitle, Resources.CalendarSmartPanelDataTitle,
                                           Resources.Data_16));
            group.Steps.Add(new WizardStep(group, new CalendarDetailGroupPage(designer),
                                           Resources.CalendarSmartPanelDetailGroupingPageTitle, Resources.CalendarSmartPanelDetailGroupingTitle,
                                           Resources.General_16));
            group.Steps.Add(new WizardStep(group, new CalendarFiltersPage(designer),
                                           Resources.CalendarSmartPanelFiltersPageTitle, Resources.CalendarSmartPanelFiltersTitle,
                                           Resources.Filters_16));
            group.Steps.Add(new WizardStep(group, new CalendarEventAppearancePage(designer),
                                           Resources.CalendarSmartPanelEventAppearancePageTitle, Resources.CalendarSmartPanelEventAppearanceTitle,
                                           Resources.EventAppearance_16));
            group.Steps.Add(new WizardStep(group, new CalendarAppearancePage(designer),
                                           Resources.CalendarSmartPanelAppearancePageTitle, Resources.CalendarSmartPanelAppearanceTitle,
                                           Resources.CalendarAppearance_16));
            group.Steps.Add(new WizardStep(group, new CalendarNavigationPage(designer),
                                           Resources.CalendarSmartPanelNavigationPageTitle, Resources.CalendarSmartPanelNavigationTitle,
                                           Resources.Navigation_16));
            group.Steps.Add(new WizardStep(group, new CalendarDataOutputPage(designer),
                                           Resources.CalendarSmartPanelDataOutputPageTitle, Resources.CalendarSmartPanelDataOutputTitle,
                                           Resources.Data_Output_16));
            return(group);
        }
        public void CalendarRenderWithNoDataBound()
        {
            PageDocument report = TestHelper.GetReport("Calendar-NoData.rdlx");

            TestingRenderingExtension rendererExt = new TestingRenderingExtension();

            report.Render(rendererExt, null);

            CalendarDataRegion calendar = rendererExt.GetReportItem("Calendar1") as CalendarDataRegion;

            Assert.IsNotNull(calendar);

            CalendarData         calendarData = new CalendarData(calendar);
            CalendarContentRange content      = new CalendarContentRange(calendar, calendarData.GetFirstMonth(), calendarData.GetLastMonth());

            // recalibrate graphics to twips
            RectangleF rect = new RectangleF(0, 0, 4000f, 4000f);

            CalendarDesigner.ScaleToTwipsGraphicsAndBound(GetGraphics(), ref rect);

            // create gdi canvas wrapper to use in renderer
            IDrawingCanvas canvas = GraphicsCanvasFactory.Create(GetGraphics());

            // render calendar to canvas
            CalendarRenderer.Instance.Render(content, canvas, rect);
        }
        public void TestRenderingInMultiThreads()
        {
            var report      = TestHelper.GetReport("Calendar.rdlx");
            var rendererExt = new TestingRenderingExtension();

            report.Render(rendererExt, null);

            var calendar = rendererExt.GetReportItem("Calendar1") as CalendarDataRegion;

            Assert.IsNotNull(calendar);

            var calendarData = new CalendarData(calendar);
            var content      = new CalendarContentRange(calendar, calendarData.GetFirstMonth(), calendarData.GetLastMonth());

            // recalibrate graphics to twips
            var rect = new RectangleF(0, 0, 4000f, 4000f);

            CalendarDesigner.ScaleToTwipsGraphicsAndBound(GetGraphics(), ref rect);

            // the action of rendering calendar to canvas
            System.Action render = () =>
            {
                using (var graphics = Graphics.FromHwnd(IntPtr.Zero))
                {
                    var canvas = GraphicsCanvasFactory.Create(graphics);
                    (calendar.GetRenderer <IGraphicsRenderer>() as CalendarRenderer)
                    .Render(content, canvas, rect);
                }
            };

            var isSuccess1 = false;
            var isSuccess2 = false;

            ThreadStart render1 = () =>
            {
                render();
                isSuccess1 = true;
            };

            ThreadStart render2 = () =>
            {
                render();
                isSuccess2 = true;
            };

            var thread1 = new Thread(render1);
            var thread2 = new Thread(render2);

            thread1.Start();
            thread2.Start();

            thread1.Join();
            thread2.Join();

            Assert.IsTrue(isSuccess1);
            Assert.IsTrue(isSuccess2);
        }
Exemple #4
0
        /// <summary>
        /// Creates and returns calendar navigation page
        /// </summary>
        public static IWizardNavigator CreateCalendarNavigationPage(CalendarDesigner designer)
        {
            IServiceProvider provider = designer.ReportItem.Site;
            IWizardNavigator group    = WizardStep.CreateaWizardNavigator(null, null, provider);

            group.Steps.Add(new WizardStep(group, new CalendarNavigationPage(designer),
                                           Resources.CalendarSmartPanelNavigationPageTitle, Resources.CalendarSmartPanelNavigationTitle, Resources.Navigation_16));
            return(group);
        }
Exemple #5
0
        /// <summary>
        /// Ensure that value size is less or equal to maxSize. If maxSize is empty, no restriction is applied.
        /// </summary>
        /// <param name="calendarDesigner"> </param>
        /// <param name="value"></param>
        /// <param name="maxSize"></param>
        /// <returns></returns>
        internal static DesignSize RestrictAtMaxSize(CalendarDesigner calendarDesigner, DesignSize value, DesignSize maxSize)
        {
            if (maxSize != DesignSize.Empty && (value.Width > maxSize.Width || value.Height > maxSize.Height))
            {
                value = new DesignSize(
                    value.Width > maxSize.Width && maxSize.Width.ToTwips() > 0 ? maxSize.Width : value.Width,
                    value.Height > maxSize.Height && maxSize.Height.ToTwips() > 0 ? maxSize.Height : value.Height);
            }

            calendarDesigner.ResizeParents(value);
            return(value);
        }
Exemple #6
0
        public DesignerImageLocatorService(CalendarDesigner calendarDesigner)
        {
            IDesignerHost host = calendarDesigner.ReportItem.Site.GetService(typeof(IDesignerHost)) as IDesignerHost;

            if (host == null)
            {
                Debug.Fail("Can get IDesignerHost for calendar report item");
                return;
            }
            _parentPageReport = host.RootComponent as PageReport;

            InitializeServices();
        }
Exemple #7
0
 public ElementNameAndOutputEditor(IServiceProvider serviceProvider, CalendarDesigner designer, bool hasAutoOption)
 {
     if (serviceProvider == null)
     {
         throw new ArgumentNullException("serviceProvider");
     }
     if (designer == null)
     {
         throw new ArgumentNullException("designer");
     }
     _serviceProvider = serviceProvider;
     _designer        = designer;
     hasAuto          = hasAutoOption;
     elementOutput    = ComponentProperty.Create(_designer.ReportItem, ReportItemDesignerBase.DataElementOutputPropertyName);
     InitializeComponent();
 }
Exemple #8
0
        /// <summary>
        /// Creates and returns the child page of calendar appearance page.
        /// </summary>
        public static IWizardNavigator CreateCalendarAppearanceChildPage(CalendarDesigner designer)
        {
            IWizardNavigator group = WizardStep.CreateaWizardNavigator(null, null, designer.ReportItem.Site);

            group.Steps.Add(new WizardStep(group, new CalendarMonthAppearancePage(designer),
                                           Resources.CalendarSmartPanelMonthTitleAppearancePageTitle, Resources.MonthAppearance_16));
            group.Steps.Add(new WizardStep(group, new CalendarDayAppearancePage(designer),
                                           Resources.CalendarSmartPanelDayAppearancePageTitle, Resources.DayAppearance_16));
            group.Steps.Add(new WizardStep(group, new CalendarDayHeadersAppearancePage(designer),
                                           Resources.CalendarSmartPanelDayHeadersAppearancePageTitle, Resources.DayHeadersAppearance_16));
            group.Steps.Add(new WizardStep(group, new CalendarWeekendAppearancePage(designer),
                                           Resources.CalendarSmartPanelWeekendAppearancePageTitle, Resources.WeekendAppearance_16));
            group.Steps.Add(new WizardStep(group, new CalendarFillerDayAppearancePage(designer),
                                           Resources.CalendarSmartPanelFillerDayAppearancePageTitle, Resources.FillerDayAppearance_16));
            return(group);
        }
 public CalendarDayAppearancePage(CalendarDesigner designer)
     : base(designer)
 {
     InitializeControls();
 }
Exemple #10
0
 public CalendarVisibilityPage(CalendarDesigner designer)
     : base(designer)
 {
     InitializeControls();
 }
 public CalendarDetailGroupPage(CalendarDesigner designer) : base(designer)
 {
     InitializeComponents();
 }
Exemple #12
0
 public CalendarDataOutputPage(CalendarDesigner designer)
     : base(designer)
 {
     InitializeControls();
 }
 public CalendarGeneralPage(CalendarDesigner designer)
     : base(designer)
 {
     InitializeControls();
 }
 public CalendarSortingPage(CalendarDesigner designer)
     : base(designer)
 {
     InitializeControls();
 }
Exemple #15
0
 protected CalendarPageBase(CalendarDesigner designer)
     : base(designer.ReportItem.Site)
 {
     _designer = designer;
 }
 public CalendarFiltersPage(CalendarDesigner designer)
     : base(designer.ReportItem.Site, new CustomDataFiltersPropertyProvider(designer.ReportItem))
 {
 }
Exemple #17
0
 public CalendarNavigationPage(CalendarDesigner designer)
     : base(designer)
 {
     InitializeControls();
     VisibleChanged += CalendarNavigationPage_VisibleChanged;
 }