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; }
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; }
//INT64 GetAverageTicksPerUnit() override; //private void GetUnit(out int pValue) override; //private void SetUnit( int value) override; //private void AddUnits( int value) override; //private void AddScopes( int value) override; //private void GetFirstUnitInThisScope(out int pValue) override; //private void GetLastUnitInThisScope(out int pValue) override; //private void OnScopeChanged() override; internal override void UpdateLabel(CalendarViewBaseItem pItem, bool isLabelVisible) { // DecadeView doesn't have a Label throw new NotImplementedException(); }