Ejemplo n.º 1
0
        internal override void UpdateLabel(CalendarViewBaseItem pItem, bool isLabelVisible)
        {
            bool showLabel = false;

            if (isLabelVisible)
            {
                DateTime date;
                var      pCalendar           = GetCalendar();
                int      day                 = 0;
                int      firstDayInThisMonth = 0;

                // TODO: consider caching the firstday flag because we also need this information when determining snap points
                // (however Decadeview doesn't need this for Label).
                date = pItem.DateBase;
                pCalendar.SetDateTime(date);
                firstDayInThisMonth = pCalendar.FirstDayInThisMonth;
                day       = pCalendar.Day;
                showLabel = firstDayInThisMonth == day;

                if (showLabel)
                {
                    string labelText;
                    labelText = pCalendar.MonthAsString(
                        0                          /* idealLength, set to 0 to get the abbreviated string */
                        );
                    pItem.UpdateLabelText(labelText);
                }
            }

            pItem.ShowLabelText(showLabel);
            return;
        }
Ejemplo n.º 2
0
        internal override void UpdateLabel(CalendarViewBaseItem pItem, bool isLabelVisible)
        {
            bool showLabel = false;

            if (isLabelVisible)
            {
                DateTime date;
                var      pCalendar            = GetCalendar();
                int      month                = 0;
                int      firstMonthOfThisYear = 0;

                // TODO: consider caching the firstday flag because we also need this information when determining snap points
                // (however Decadeview doesn't need this for Label).
                date = pItem.DateBase;
                pCalendar.SetDateTime(date);
                firstMonthOfThisYear = pCalendar.FirstMonthInThisYear;
                month = pCalendar.Month;

                showLabel = firstMonthOfThisYear == month;

                if (showLabel)
                {
                    string labelText;
                    labelText = pCalendar.YearAsString();
                    pItem.UpdateLabelText(labelText);
                }
            }

            pItem.ShowLabelText(showLabel);
            return;
        }