Esempio n. 1
0
 private void DrawWeekLetters(Graphics g, MonthLayout layout)
 {
     if (this.m_layout.ShowWeekLetters)
     {
         string weekDayNames = this.GetWeekDayNames();
         if (!this.m_useGradient)
         {
             g.FillRectangle(this.m_brushWeekLettersBack, layout.MonthCaptionBounds.Left, layout.MonthCaptionBounds.Bottom, layout.Width, this.m_layout.WeekLettersHeight);
         }
         for (int i = 0; i < 7; i++)
         {
             int length = weekDayNames.Length / 7;
             string str2 = weekDayNames.Substring(i * length, length);
             Size size = g.MeasureString(str2.ToString(), this.m_fontWeekLetters).ToSize();
             Point point = new Point(layout.GetCellBounds(i).Left + ((layout.GetCellBounds(i).Width - size.Width) / 2), layout.MonthCaptionBounds.Bottom + ((this.m_layout.WeekLettersHeight - size.Height) / 2));
             DayOfWeek week = (DayOfWeek)((i + (int)this.GetFirstDayOfWeek()) % 7);
             g.DrawString(str2.ToString(), this.m_fontWeekLetters, (week == DayOfWeek.Saturday) ? ((this.m_brushWeekLettersSaturday.Color == Color.Transparent) ? this.m_brushWeekLettersText : this.m_brushWeekLettersSaturday) : ((week == DayOfWeek.Sunday) ? ((this.m_brushWeekLettersSunday.Color == Color.Transparent) ? this.m_brushWeekLettersText : this.m_brushWeekLettersSunday) : this.m_brushWeekLettersText), (float) point.X, (float) point.Y);
         }
     }
 }
Esempio n. 2
0
 private void DrawWeekNumbers(Graphics g, MonthLayout layout, int monthIndex)
 {
     if (this.m_layout.ShowWeekNumbers)
     {
         if (!this.m_useGradient)
         {
             g.FillRectangle(this.m_brushWeekLettersBack, layout.X, layout.InnerBounds.Top, this.m_layout.WeekNumbersWidth, layout.InnerBounds.Height);
         }
         int monthCount = this.m_monthCount;
         for (int i = 0; i < 6; i++)
         {
             DateTime day = this.GetDay(monthIndex, (i * 7) + 6);
             if (day == DateTime.MinValue)
             {
                 day = this.GetDay(monthIndex, i * 7);
                 if (day == DateTime.MinValue)
                 {
                     goto Label_01EE;
                 }
                 day = day.AddDays(6.0);
             }
             int num3 = CultureInfo.CurrentCulture.Calendar.GetWeekOfYear(day, this.CalendarWeekRule, this.GetFirstDayOfWeek());
             bool flag = num3 < 10;
             string text = (flag ? "0" : "") + num3.ToString();
             Size size = g.MeasureString(text, base.Font).ToSize();
             Point point = new Point(layout.X + ((this.m_layout.WeekNumbersWidth - size.Width) / 2), layout.GetCellBounds((i * 7) + 6).Top + ((layout.GetCellBounds((i * 7) + 6).Height - size.Height) / 2));
             int num4 = (((this.m_curMonth - 1) + monthIndex) % 12) + 1;
             int month = day.AddDays(-6.0).Month;
             g.DrawString(text, base.Font, (((month < num4) && (monthIndex == 0)) || ((month > num4) && (monthIndex == (monthCount - 1)))) ? this.m_brushOther : this.m_brushCur, (float) point.X, (float) point.Y);
             if (flag)
             {
                 g.DrawString("0", base.Font, this.m_brushWeekLettersBack, (float) point.X, (float) point.Y);
             }
         Label_01EE:;
         }
     }
 }
Esempio n. 3
0
 private void DrawMonthFrame(Graphics g, MonthLayout layout)
 {
     if (this.MonthsGrid)
     {
         g.DrawRectangle(this.m_penMonthsGrid, layout.X, layout.Y, layout.Width - 1, layout.Height - 1);
     }
 }
Esempio n. 4
0
 private void DrawUpperBorder(Graphics g, MonthLayout layout)
 {
     if (this.m_layout.ShowWeekLetters)
     {
         g.DrawLine(this.m_penFrame, layout.InnerBounds.Left + 3, layout.InnerBounds.Top, layout.InnerBounds.Right - 3, layout.InnerBounds.Top);
     }
 }
Esempio n. 5
0
 private void DrawMonth(Graphics g, MonthLayout layout, int monthIndex)
 {
     this.DrawMonthCaption(g, layout.MonthCaptionBounds, monthIndex);
     this.DrawWeekLetters(g, layout);
     this.DrawWeekNumbers(g, layout, monthIndex);
     this.DrawDays(g, layout, monthIndex);
     this.DrawDaysGrid(g, layout);
     this.DrawBorders(g, layout);
     this.DrawMonthFrame(g, layout);
 }
Esempio n. 6
0
 private void DrawLeftBorder(Graphics g, MonthLayout layout)
 {
     if (this.m_layout.ShowWeekNumbers)
     {
         g.DrawLine(this.m_penFrame, layout.InnerBounds.Left, layout.InnerBounds.Top + 3, layout.InnerBounds.Left, layout.InnerBounds.Bottom - 3);
     }
 }
Esempio n. 7
0
 private void DrawDaysGrid(Graphics g, MonthLayout layout)
 {
     if (this.DaysGrid)
     {
         int cellCountX = layout.CellCountX;
         int cellCountY = layout.CellCountY;
         int num3 = (int) Math.Ceiling(((double) cellCountX) / 2.0);
         int num4 = (int) Math.Ceiling(((double) cellCountY) / 2.0);
         for (int i = 0; i < num3; i++)
         {
             g.DrawRectangle(this.m_penDaysGrid, layout.GetCellBounds(i * 2).X, layout.InnerBounds.Y, layout.GetCellBounds(i * 2).Width - 1, layout.InnerBounds.Height);
         }
         for (int j = 0; j < num4; j++)
         {
             g.DrawRectangle(this.m_penDaysGrid, layout.InnerBounds.X, layout.GetCellBounds((j * 2) * 7).Y, layout.InnerBounds.Width, layout.GetCellBounds((j * 2) * 7).Height - 1);
         }
         g.DrawRectangle(this.m_penDaysGrid, layout.InnerBounds);
     }
 }
Esempio n. 8
0
 private void DrawDays(Graphics g, MonthLayout layout, int monthIndex)
 {
     int num = 0x2a;
     for (int i = 0; i < num; i++)
     {
         DateTime day = this.GetDay(monthIndex, i);
         this.DrawDay(g, this.GetDay(monthIndex, i), (day.Date == this.m_curSel.Date) && !this.m_isNone, false, false, layout.GetCellBounds(i), monthIndex, i);
     }
 }
Esempio n. 9
0
 private void DrawBorders(Graphics g, MonthLayout layout)
 {
     this.DrawLeftBorder(g, layout);
     this.DrawUpperBorder(g, layout);
 }