HeaderPane
Main
Hide
Share Link
Print

RecurrenceEnum Enumeration

Defines how a special date repeats.

Namespace: Softelvdm.SftDateNET
Assembly: Softelvdm.SftDateNET

Syntax

public enum RecurrenceEnum;
Public Enum RecurrenceEnum

Values

NameDescription
NoneThe special date applies to its date only.
WeeklyThe special date applies to every date on the same day of the week.
MonthlyThe special date applies to the same day of every month.
AnnuallyThe special date applies to the same day and month of every year.

Comments

Defines how a special date repeats.

Examples

C# View entire sample code

        // Special dates repeat every year, month or week, and can be bold, colored, disabled or show a tooltip.
        private void checkHolidays_CheckedChanged(object sender, EventArgs e) {
            int year = DateTime.Today.Year;
            DateTime monday = DateTime.Today.AddDays(-(((int)DateTime.Today.DayOfWeek + 6) % 7));
            ForEachCalendar(delegate (CalendarClass calendar) {
                calendar.SpecialDates.Clear();
                if (!checkHolidays.Checked)
                    return;
                SpecialDateClass day = calendar.SpecialDates.Add(new DateTime(year, 1, 1), RecurrenceEnum.Annually);
                day.Bold = true;
                day.ForeColor = Color.Firebrick;
                day.ToolTip = "New Year's Day";
                day = calendar.SpecialDates.Add(new DateTime(year, 7, 4), RecurrenceEnum.Annually);
                day.Bold = true;
                day.ForeColor = Color.Firebrick;
                day.ToolTip = "Independence Day";

VB.NET View entire sample code

    ' Special dates repeat every year, month or week, and can be bold, colored, disabled or show a tooltip.
    Private Sub CheckHolidays_CheckedChanged(ByVal sender As Object, ByVal e As EventArgs) Handles CheckHolidays.CheckedChanged
        Dim year As Integer = DateTime.Today.Year
        Dim monday As DateTime = DateTime.Today.AddDays(-((CInt(DateTime.Today.DayOfWeek) + 6) Mod 7))
        For Each calendar As CalendarClass In AllCalendars()
            calendar.SpecialDates.Clear()
            If CheckHolidays.Checked Then
                Dim day As SpecialDateClass = calendar.SpecialDates.Add(New DateTime(year, 1, 1), RecurrenceEnum.Annually)
                day.Bold = True
                day.ForeColor = Color.Firebrick
                day.ToolTip = "New Year's Day"
                day = calendar.SpecialDates.Add(New DateTime(year, 7, 4), RecurrenceEnum.Annually)
                day.Bold = True
                day.ForeColor = Color.Firebrick
                day.ToolTip = "Independence Day"
                day = calendar.SpecialDates.Add(New DateTime(year, 12, 25), RecurrenceEnum.Annually)

See Also Classes | SftDate/NET 3.0