Пример #1
0
        private void trafficReport_Click(object sender, RoutedEventArgs e)
        {
            var docPrinter = new FlowDocumentPrinter();
            var printer    = new TrafficReportPrinter();

            docPrinter.PrintFlowDocument(() => printer.Print());
        }
Пример #2
0
        private void printEventsPerSessionMenuItem_Click(object sender, RoutedEventArgs e)
        {
            var docPrinter = new FlowDocumentPrinter();
            var printer    = new TrafficReportPrinter();

            docPrinter.PrintFlowDocument(() => printer.PrintEventsPerSession());
        }
Пример #3
0
        private void totalIncomeByMethodMenuItem_Click(object sender, RoutedEventArgs e)
        {
            var docPrinter = new FlowDocumentPrinter();
            var printer    = new TotalIncomeByMethodReportPrinter();

            docPrinter.PrintFlowDocument(() => printer.Print(true));
        }
        private void print_Click(object sender, RoutedEventArgs e)
        {
            var documentPrinter = new FlowDocumentPrinter();
            var printer         = new ContestantResultsPrinter();

            documentPrinter.PrintFlowDocument(() => printer.Print(ViewModel));
        }
Пример #5
0
        private void nonEventIncomeMenuItem_Click(object sender, RoutedEventArgs e)
        {
            var docPrinter = new FlowDocumentPrinter();
            var printer    = new EventIncomeReportPrinter();

            docPrinter.PrintFlowDocument(() => printer.Print(false));
        }
Пример #6
0
        private void daysReportMenuItem_Click(object sender, RoutedEventArgs e)
        {
            var dlg = new SelectDateDialog();

            if (dlg.ShowDialog().Value)
            {
                var docPrinter = new FlowDocumentPrinter();
                docPrinter.PrintFlowDocuments(() => FlowDocumentsForDay(dlg.SelectedDate));
            }
        }
Пример #7
0
        private void arbitersBadgesMenuItem_Click(object sender, RoutedEventArgs e)
        {
            MessageBox.Show("Please ensure that YELLOW paper is in the printer");

            var docPrinter = new FlowDocumentPrinter();
            var printer    = new ArbitersBadgesPrinter();

            docPrinter.PrintFlowDocument(() => printer.Print());

            MessageBox.Show("Please take the yellow paper out of the printer now");
        }
Пример #8
0
        private void eventLabelsMenuItem_Click(object sender, RoutedEventArgs e)
        {
            MessageBox.Show("Please ensure that Avery 3x6 labels are in the printer");

            var docPrinter = new FlowDocumentPrinter();
            var printer    = new EventLabelsPrinter();

            docPrinter.PrintFlowDocument(() => printer.Print(), includeFooter: false);

            MessageBox.Show("Please take the labels out of the printer now");
        }
Пример #9
0
        private void peopleOwingMoneyMenuItem_Click(object sender, RoutedEventArgs e)
        {
            Func <FlowDocument> generate = () =>
            {
                var printer = new PeopleOwingMoneyReportPrinter();
                return(printer.Print(true));
            };
            Action <FlowDocument> print = doc =>
            {
                var flowDocumentPrinter = new FlowDocumentPrinter();
                flowDocumentPrinter.PrintFlowDocument(doc);
            };
            FlowDocumentPreviewDialog dialog = new FlowDocumentPreviewDialog(generate, print);

            dialog.ShowDialog();
        }
Пример #10
0
        private void modernAbstractStandings_Click(object sender, RoutedEventArgs e)
        {
            Func <FlowDocument> generate = () =>
            {
                var printer = new PentamindStandingsPrinter();
                return(printer.PrintModernAbstract());
            };
            Action <FlowDocument> print = doc =>
            {
                var flowDocumentPrinter = new FlowDocumentPrinter();
                flowDocumentPrinter.PrintFlowDocument(doc, includeFooter: false);
            };
            FlowDocumentPreviewDialog dialog = new FlowDocumentPreviewDialog(generate, print);

            dialog.ShowDialog();
        }
Пример #11
0
        public void print_Click(object sender, EventArgs e)
        {
            Func <FlowDocument> generate = () =>
            {
                var printer = new SingleEventResultsPrinter(ViewModel.CurrentOlympiadId, ViewModel.EventCode);
                return(printer.Print());
            };
            Action <FlowDocument> print = doc =>
            {
                var printer = new FlowDocumentPrinter();
                printer.PrintFlowDocument(doc, includeFooter: false);
            };
            var dlg = new FlowDocumentPreviewDialog(generate, print);

            dlg.ShowDialog();
        }
Пример #12
0
        private void eventsWithPrizes_Click(object sender, RoutedEventArgs e)
        {
            Func <FlowDocument> generate = () =>
            {
                var printer = new EventsWithPrizesPrinter();
                return(printer.GenerateDocument());
            };
            Action <FlowDocument> print = doc =>
            {
                var docPrinter = new FlowDocumentPrinter();
                docPrinter.PrintFlowDocument(doc);
            };

            var previewer = new FlowDocumentPreviewDialog(generate, print);

            previewer.ShowDialog();
        }
Пример #13
0
        private void entrySummaryMenuItem_Click(object sender, RoutedEventArgs e)
        {
            Func <FlowDocument> generate = () =>
            {
                var printer = new PrintEventEntriesSummaryReportPrinter();
                return(printer.GenerateDocument());
            };

            Action <FlowDocument> print = doc =>
            {
                var docPrinter = new FlowDocumentPrinter();
                docPrinter.PrintFlowDocument(doc);
            };

            var previewer = new FlowDocumentPreviewDialog(generate, print);

            previewer.ShowDialog();
        }
Пример #14
0
        private void prizeFormsMenuItem_Click(object sender, RoutedEventArgs e)
        {
            Func <FlowDocument> generate = () =>
            {
                var printer = new PrizeFormsPrinter();
                return(printer.Print());
            };
            Action <FlowDocument> print = doc =>
            {
                MessageBox.Show("Please ensure that YELLOW paper is in the printer");
                var docPrinter = new FlowDocumentPrinter();
                docPrinter.PrintFlowDocument(doc, includeFooter: false);
                MessageBox.Show("Please take the yellow paper out of the printer now");
            };

            var dlg = new FlowDocumentPreviewDialog(generate, print);

            dlg.ShowDialog();
        }
Пример #15
0
        private void medalFormsMenuItem_Click(object sender, RoutedEventArgs e)
        {
            var dialog = new EventEntriesReportPicker();

            if (dialog.ShowDialog().Value)
            {
                var          printer = new MedalFormsPrinter();
                FlowDocument doc;
                if (dialog.UseEvent)
                {
                    doc = printer.Print(dialog.EventCode);
                }
                else
                {
                    doc = printer.Print(dialog.StartDate, dialog.EndDate);
                }

                var flowDocumentPrinter = new FlowDocumentPrinter();
                flowDocumentPrinter.PrintFlowDocument(() => doc, includeFooter: false);
            }
        }
Пример #16
0
        private void printTodaysEventsMenuItem_Click(object sender, RoutedEventArgs e)
        {
            // We mess up the document when we put it in the previewer so need to get it again;
            // would be nice to cache a copy
            var dlg = new SelectDateDialog();

            if (dlg.ShowDialog().Value)
            {
                Func <FlowDocument> generate = () =>
                {
                    var printer = new TodaysEventsPrinter();
                    return(printer.Print(dlg.SelectedDate));
                };
                Action <FlowDocument> print = doc =>
                {
                    var docPrinter = new FlowDocumentPrinter();
                    docPrinter.PrintFlowDocument(doc);
                };

                var previewer = new FlowDocumentPreviewDialog(generate, print);
                previewer.ShowDialog();
            }
        }