Example #1
0
        private void printDocumentMatch_PrintPage(object sender, PrintPageEventArgs e)
        {
            int   i          = 0;
            int   itemHeight = 0;
            Point startingPoint;

            foreach (var item in flpMatchStatistics.Controls)
            {
                startingPoint = new Point
                {
                    X = e.MarginBounds.Left,
                    Y = e.MarginBounds.Top + itemHeight
                };
                itemHeight = itemHeight + 110;



                MatchStats statFrame = item as MatchStats;

                var bmp = new Bitmap(statFrame.Size.Width, statFrame.Size.Height);
                statFrame.DrawToBitmap(bmp, new Rectangle
                {
                    X      = 0,
                    Y      = 0,
                    Width  = statFrame.ClientSize.Width,
                    Height = statFrame.ClientSize.Height
                });


                e.Graphics.DrawImage(bmp, startingPoint);
                i++;
            }
        }
Example #2
0
        private void RefreshMatchList()
        {
            matches = matches.OrderByDescending(match => match.Attendance).ToList();

            flpMatchStatistics.Controls.Clear();
            foreach (var match in matches)
            {
                MatchStats ms = new MatchStats((match as Match));


                flpMatchStatistics.Controls.Add(ms);
            }
        }