Exemplo n.º 1
0
        // Layout all the pages, return the total number of pages.
        protected override int LayoutPages(PageSettings pageSettings, SizeF printArea)
        {
            pageSettings.PrinterSettings.Copies  = (short)coursePrintSettings.Count;
            pageSettings.PrinterSettings.Collate = false;      // print all of one course, then all of next, etc.

            CoursePageLayout pageLayout = new CoursePageLayout(eventDB, symbolDB, controller, appearance, coursePrintSettings.CropLargePrintArea);
            IEnumerable <CourseDesignator> courseDesignators = QueryEvent.EnumerateCourseDesignators(eventDB, coursePrintSettings.CourseIds, coursePrintSettings.VariationChoicesPerCourse, !coursePrintSettings.PrintMapExchangesOnOneMap);

            pages = pageLayout.LayoutPages(courseDesignators);

            return(pages.Count);            // total number of pages.
        }
Exemplo n.º 2
0
        protected override IPrintableRectangle[] GetDescriptionList()
        {
            List <IPrintableRectangle> rendererList = new List <IPrintableRectangle>();

            // Get the list of renderers for the descriptions we're printing.
            foreach (CourseDesignator designator in QueryEvent.EnumerateCourseDesignators(
                         eventDB, punchPrintSettings.CourseIds, punchPrintSettings.VariationChoicesPerCourse, false))
            {
                rendererList.Add(GetRenderer(CourseView.CreateViewingCourseView(eventDB, designator)));
            }

            return(rendererList.ToArray());
        }
Exemplo n.º 3
0
        List <Pair <string, CourseDesignator> > GetFilesToCreate()
        {
            List <Pair <string, CourseDesignator> > fileList = new List <Pair <string, CourseDesignator> >();

            // Create a file for each course part or variation (or both)
            foreach (CourseDesignator designator in
                     QueryEvent.EnumerateCourseDesignators(eventDB, bitmapCreationSettings.CourseIds,
                                                           bitmapCreationSettings.VariationChoicesPerCourse, !bitmapCreationSettings.PrintMapExchangesOnOneMap))
            {
                fileList.Add(new Pair <string, CourseDesignator>(CreateOutputFileName(designator), designator));
            }

            return(fileList);
        }
Exemplo n.º 4
0
        List <Pair <string, IEnumerable <CourseDesignator> > > GetFilesToCreate()
        {
            List <Pair <string, IEnumerable <CourseDesignator> > > fileList = new List <Pair <string, IEnumerable <CourseDesignator> > >();

            switch (coursePdfSettings.FileCreation)
            {
            case CoursePdfSettings.PdfFileCreation.SingleFile:
                // All pages go into a single file.
                fileList.Add(new Pair <string, IEnumerable <CourseDesignator> >(CreateOutputFileName(null),
                                                                                QueryEvent.EnumerateCourseDesignators(eventDB, coursePdfSettings.CourseIds, coursePdfSettings.VariationChoicesPerCourse, !coursePdfSettings.PrintMapExchangesOnOneMap)));
                break;

            case CoursePdfSettings.PdfFileCreation.FilePerCourse:
                // Create a file for each course.
                foreach (Id <Course> courseId in coursePdfSettings.CourseIds)
                {
                    fileList.Add(new Pair <string, IEnumerable <CourseDesignator> >(CreateOutputFileName(new CourseDesignator(courseId)),
                                                                                    QueryEvent.EnumerateCourseDesignators(eventDB, new Id <Course>[1] {
                        courseId
                    }, coursePdfSettings.VariationChoicesPerCourse, !coursePdfSettings.PrintMapExchangesOnOneMap)));
                }
                break;

            case CoursePdfSettings.PdfFileCreation.FilePerCoursePart:
                // Create a file for each course part or variation (or both)
                foreach (CourseDesignator designator in
                         QueryEvent.EnumerateCourseDesignators(eventDB, coursePdfSettings.CourseIds,
                                                               coursePdfSettings.VariationChoicesPerCourse, !coursePdfSettings.PrintMapExchangesOnOneMap))
                {
                    fileList.Add(new Pair <string, IEnumerable <CourseDesignator> >(CreateOutputFileName(designator), new[] { designator }));
                }

                break;
            }

            return(fileList);
        }
Exemplo n.º 5
0
 // Enumerator all course designators to create.
 private IEnumerable <CourseDesignator> EnumerateCourseDesignators()
 {
     return(QueryEvent.EnumerateCourseDesignators(eventDB, creationSettings.CourseIds, creationSettings.VariationChoicesPerCourse, true));
 }