예제 #1
0
        private void persianCalendar(int startDay, int nDays)
        {
            int i, j;

            reset();

            for (i = startDay; i <= 6; i++)
            {
                var curDay = i - startDay + 1;
                DaysInfo[i + 7].Number          = curDay.ToString(CultureInfo.InvariantCulture);
                DaysInfo[i + 7].BackgroundBrush = CustomBrushes.BorderBlueBackground();
                DaysInfo[i + 7].BorderBrush     = CustomBrushes.CellsBorederBrush();
                DaysInfo[i + 7].Foreground      = CustomBrushes.CellsForeground();
            }

            var k = 7;

            for (j = 6 - startDay + 1; j <= nDays - 1; j++)
            {
                var curDay = j + 1;
                DaysInfo[k + 7].Number          = curDay.ToString(CultureInfo.InvariantCulture);
                DaysInfo[k + 7].BackgroundBrush = CustomBrushes.BorderBlueBackground();
                DaysInfo[k + 7].BorderBrush     = CustomBrushes.CellsBorederBrush();
                DaysInfo[k + 7].Foreground      = CustomBrushes.CellsForeground();
                k = k + 1;
            }
        }
예제 #2
0
        private void highlightThisday(int year, int month, int day)
        {
            if (_currentMonth + 1 != month || _currentYear != year)
            {
                return;
            }

            //reset
            if (_lastSelectedIdx != -1)
            {
                DaysInfo[_lastSelectedIdx].BackgroundBrush = CustomBrushes.BorderBlueBackground();
                DaysInfo[_lastSelectedIdx].BorderBrush     = CustomBrushes.CellsBorederBrush();
                DaysInfo[_lastSelectedIdx].Foreground      = CustomBrushes.CellsForeground();
                DaysInfo[_lastSelectedIdx].FontWeight      = FontWeights.Normal;
            }

            for (var i = 0; i <= 41; i++)
            {
                if (DaysInfo[i + 7].Number != day.ToString(CultureInfo.InvariantCulture))
                {
                    continue;
                }
                DaysInfo[i + 7].FontWeight      = FontWeights.Bold;
                DaysInfo[i + 7].BackgroundBrush = CustomBrushes.HighlightBackground();
                DaysInfo[i + 7].BorderBrush     = CustomBrushes.HightlightBorderBrush();
                _lastSelectedIdx = i + 7;
            }
        }