void CreateCheckMultiColumnReportModuleActions()
        {
            AddLoadModuleActions(typeof(MultiColumnModule));
            foreach (PageNumberKind pageNumberKind in (System.Collections.IEnumerable)DispatchExpr(() => ColumnReportModule.pageNumberKindEdit.ItemsSource))
            {
                IAmAlive("Changing the number kind");
                PageNumberKind temp_pageNumberKind = pageNumberKind;
                Dispatch(() => { ColumnReportModule.pageNumberKindEdit.EditValue = temp_pageNumberKind; });
                WaitDocumentBuildCompleted();

                foreach (HorizontalAlignment pageNumberAlignment in (System.Collections.IEnumerable)DispatchExpr(() => ColumnReportModule.pageNumberAlignmentEdit.ItemsSource))
                {
                    HorizontalAlignment temp_pageNumberAlignment = pageNumberAlignment;
                    Dispatch(() => { ColumnReportModule.pageNumberAlignmentEdit.EditValue = temp_pageNumberAlignment; });
                    WaitDocumentBuildCompleted();

                    foreach (PageNumberLocation pageNumberLocation in (System.Collections.IEnumerable)DispatchExpr(() => ColumnReportModule.pageNumberLocationEdit.ItemsSource))
                    {
                        PageNumberLocation temp_pageNumberLocation = pageNumberLocation;
                        Dispatch(() => { ColumnReportModule.pageNumberLocationEdit.EditValue = temp_pageNumberLocation; });
                        WaitDocumentBuildCompleted();
                    }
                }
            }

            Dispatch(() => { ColumnReportModule.downThenAcross.IsChecked = true; });
            WaitDocumentBuildCompleted();
            Dispatch(() => { ColumnReportModule.acrossThenDown.IsChecked = true; });
            WaitDocumentBuildCompleted();
            Dispatch(() => { EditorsActions.SetEditValue(ColumnReportModule.pageNumberFormatEdit, "Page {test}"); });
            WaitDocumentBuildCompleted();
        }
예제 #2
0
        /// <summary>
        /// Drukuje nr strony na górnym lub dolnym marginesie
        /// </summary>
        /// <param name="PageNumber">Nr strony</param>
        /// <param name="x">współrzędna x</param>
        /// <param name="y">współrzędna y</param>
        /// <param name="PrintWidth">Szerokość obszaru wydruku</param>
        /// <param name="Location">Lokalizacja nr strony (górny lub dolny margines)</param>
        /// <param name="HorizontalAlignment">Poziome położenie nr strony</param>
        public void DrawPageNumber(string PageNumber, float x, float y, float PrintWidth, PageNumberLocation Location, byte HorizontalAlignment = 1)
        {
            x += UserSession.User.Settings.XCaliber;
            y += UserSession.User.Settings.YCaliber;
            //var M = new CalcHelper.Math();
            var BaseFont = new Font("Arial", 8, FontStyle.Regular, GraphicsUnit.Point);

            if (Location == PageNumberLocation.Header)
            {
                y -= CalcHelper.Math.MMtoIN(5) + BaseFont.GetHeight(G);
            }
            else
            {
                y += CalcHelper.Math.MMtoIN(5) + BaseFont.GetHeight(G);
            }
            var strFormat = new StringFormat();

            strFormat.LineAlignment = StringAlignment.Center;
            strFormat.Alignment     = (StringAlignment)HorizontalAlignment;
            G.DrawString(PageNumber, BaseFont, Brushes.Black, new Rectangle((int)x, (int)y, (int)PrintWidth, (int)BaseFont.GetHeight(G)), strFormat);
        }