バージョン

PatternDaysOfWeek プロパティ (AppointmentRecurrence)

アイテムが発生する曜日を取得または設定します。
シンタックス
'宣言
 
Public Overrides Property PatternDaysOfWeek As RecurrencePatternDaysOfWeek
public override RecurrencePatternDaysOfWeek PatternDaysOfWeek {get; set;}
解説

注: PatternDaysOfWeek プロパティの値はビットフラグで表されるため、プロパティで複数日を表示できます。

PatternFrequency プロパティを「Daily」に設定した場合、PatternDaysOfWeek プロパティは「All」または「AllWeekdays」にのみ設定できます。プロパティを他の値に設定した場合は例外がスローされます。

PatternFrequency プロパティを「Weekly」に設定した場合、PatternDaysOfWeek プロパティは「None」に設定できません。そうすると、例外がスローされます。

PatternFrequency プロパティを「Monthly」または「Yearly」に設定した場合、PatternDaysOfWeek プロパティは適用されません。

使用例
Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinSchedule
Imports System.Diagnostics

    Private Sub CreateRecurringAppointments()
        ' The 'PatternDaysOfWeek' is used by weekly, 
        ' calculated monthly, calculated yearly and 
        ' also daily appointments that occur every
        ' weekday.
        '

        ' For an every weekday type daily recurrence,
        ' the 'PatternDaysOfWeek' is used to specify
        ' that the appointment is limited to the
        ' weekdays.
        '

        ' create a new appointment
        Dim dailyAppt As Appointment = Me.ultraCalendarInfo1.Appointments.Add(DateTime.Now, DateTime.Now.AddHours(3D), String.Empty)

        ' create the recurrence object - this appointment
        ' will become the rootappointment (or representation
        ' of the series) - it's 'IsRecurringAppointmentRoot'
        ' will return true and it will not displayed in 
        ' the associated controls. instead, instances or 
        ' occurrences of the recurrence will appear in the
        ' the controls associated with the calendar info.
        dailyAppt.Recurrence = New AppointmentRecurrence()

        ' This will be a daily appointment that will occur
        ' each weekday
        dailyAppt.Recurrence.PatternFrequency = RecurrencePatternFrequency.Daily

        ' In this case, we use the 'PatternDaysOfWeek' to
        ' indicate that the daily occurrences should fall
        ' on every weekday (each day but saturday and sunday).
        dailyAppt.Recurrence.PatternDaysOfWeek = RecurrencePatternDaysOfWeek.AllWeekdays

        ' assign a subject [not required]
        dailyAppt.Subject = "A daily activity"


        ' For a weekly appointment, the 'PatternDaysOfWeek'
        ' indicates which days of the week, the occurrences
        ' will land upon. e.g. Friday; Monday and Tuesday;
        ' all weekdays; all weekend days; etc.
        '

        ' create a new appointment
        Dim dt As DateTime = DateTime.Now
        Dim weekAppt As Appointment = Me.ultraCalendarInfo1.Appointments.Add(dt, dt.AddDays(1D), String.Empty)

        ' create the recurrence object - see above for more
        weekAppt.Recurrence = New AppointmentRecurrence()

        ' the 'PatternFrequency' indicates the frequency of the recurrence.
        weekAppt.Recurrence.PatternFrequency = RecurrencePatternFrequency.Weekly

        ' the recurrence should occur every week
        weekAppt.Recurrence.PatternInterval = 1

        ' The 'PatternDaysOfWeek' specifies which days, the 
        ' occurrences will occur. in this example, an occurence
        ' will occur every tuesday and another every friday
        ' of every week (since the patterninterval we specified
        ' was 1)
        '
        weekAppt.Recurrence.PatternDaysOfWeek = RecurrencePatternDaysOfWeek.Tuesday Or _
                  RecurrencePatternDaysOfWeek.Friday

        weekAppt.Subject = "A weekly recurrence that occurs Tuesday and Friday of every other week."

        ' For a calculated monthly recurrence, the 'PatternDaysOfWeek'
        ' is used in conjuction with the 'PatternInterval' and
        ' and 'PatternOccurrenceOfDayInMonth' to determine which
        ' day of the month will be the start of each occurrence
        '

        ' create a new appointment
        Dim mthAppt As Appointment = Me.ultraCalendarInfo1.Appointments.Add(dt, dt.AddHours(3D), String.Empty)

        ' create the recurrence object - this appointment
        ' will become the rootappointment (or representation
        ' of the series) - see above for more
        mthAppt.Recurrence = New AppointmentRecurrence()

        ' this will be a monthly recurrence
        mthAppt.Recurrence.PatternFrequency = RecurrencePatternFrequency.Monthly

        ' the appointment will occur every other month so we specify
        ' a patterninterval of 2
        mthAppt.Recurrence.PatternInterval = 2

        ' to have an appt occur based on a particular pattern (first, second, 
        ' last, etc.) the patterntype must be set to calculated.
        mthAppt.Recurrence.PatternType = RecurrencePatternType.Calculated

        ' then you need to specify the calculatation. in this case, we want 
        ' the last weekday in the month
        mthAppt.Recurrence.PatternOccurrenceOfDayInMonth = RecurrencePatternOccurrenceOfDayInMonth.Last
        mthAppt.Recurrence.PatternDaysOfWeek = RecurrencePatternDaysOfWeek.AllWeekendDays

        ' we could have also specified a particular day
        ' e.g.
        ' appt.Recurrence.PatternDaysOfWeek = RecurrencePatternDaysOfWeek.Friday;

        ' the description provides a description of the recurrence info
        mthAppt.Subject = mthAppt.Recurrence.Description


        ' For a calculated yearly recurrence, the 'PatternDaysOfWeek' is
        ' used to determine which day of the month in the year
        ' the occurrences will start.
        '

        ' create a new appointment
        Dim yrAppt As Appointment = Me.ultraCalendarInfo1.Appointments.Add(DateTime.Today, String.Empty)
        yrAppt.AllDayEvent = True

        ' create the recurrence object - this appointment
        ' will become the rootappointment (or representation
        ' of the series) - see above for more
        yrAppt.Recurrence = New AppointmentRecurrence()

        ' this is a yearly occurrence
        yrAppt.Recurrence.PatternFrequency = RecurrencePatternFrequency.Yearly

        ' to have an appt occur based on a particular pattern (first, second, 
        ' last, etc.) the patterntype must be set to calculated.
        yrAppt.Recurrence.PatternType = RecurrencePatternType.Calculated

        ' we are creating an appt for hanksgiving, which 
        ' occurs on the 4th thursday of november so we'll
        ' specify a 'PatternMonthOfYear' of 11 for november
        yrAppt.Recurrence.PatternMonthOfYear = 11

        ' its the fourth thursday so specify fourth...
        yrAppt.Recurrence.PatternOccurrenceOfDayInMonth = RecurrencePatternOccurrenceOfDayInMonth.Fourth

        ' and it falls on thursday...
        yrAppt.Recurrence.PatternDaysOfWeek = RecurrencePatternDaysOfWeek.Thursday

        ' the description provides a description of the recurrence info
        yrAppt.Subject = "Thanksgiving"
    End Sub
using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.UltraWinSchedule;
using System.Diagnostics;

		private void CreateRecurringAppointments()
		{
			// The 'PatternDaysOfWeek' is used by weekly, 
			// calculated monthly, calculated yearly and 
			// also daily appointments that occur every
			// weekday.
			//

			// For an every weekday type daily recurrence,
			// the 'PatternDaysOfWeek' is used to specify
			// that the appointment is limited to the
			// weekdays.
			//

			// create a new appointment
			Appointment dailyAppt = this.ultraCalendarInfo1.Appointments.Add(DateTime.Now, DateTime.Now.AddHours(3d), string.Empty);

			// create the recurrence object - this appointment
			// will become the rootappointment (or representation
			// of the series) - it's 'IsRecurringAppointmentRoot'
			// will return true and it will not displayed in 
			// the associated controls. instead, instances or 
			// occurrences of the recurrence will appear in the
			// the controls associated with the calendar info.
			dailyAppt.Recurrence = new AppointmentRecurrence();

			// This will be a daily appointment that will occur
			// each weekday
			dailyAppt.Recurrence.PatternFrequency = RecurrencePatternFrequency.Daily;

			// In this case, we use the 'PatternDaysOfWeek' to
			// indicate that the daily occurrences should fall
			// on every weekday (each day but saturday and sunday).
			dailyAppt.Recurrence.PatternDaysOfWeek = RecurrencePatternDaysOfWeek.AllWeekdays;

			// assign a subject [not required]
			dailyAppt.Subject = "A daily activity";


			// For a weekly appointment, the 'PatternDaysOfWeek'
			// indicates which days of the week, the occurrences
			// will land upon. e.g. Friday; Monday and Tuesday;
			// all weekdays; all weekend days; etc.
			//

			// create a new appointment
			DateTime dt = DateTime.Now;
			Appointment weekAppt = this.ultraCalendarInfo1.Appointments.Add(dt, dt.AddDays(1d), string.Empty);

			// create the recurrence object - this appointment
			// will become the rootappointment (or representation
			// of the series) - see above for more
			weekAppt.Recurrence = new AppointmentRecurrence();

			// the 'PatternFrequency' indicates the frequency of the recurrence.
			weekAppt.Recurrence.PatternFrequency = RecurrencePatternFrequency.Weekly;

			// the recurrence should occur every week
			weekAppt.Recurrence.PatternInterval = 1;

			// The 'PatternDaysOfWeek' specifies which days, the 
			// occurrences will occur. in this example, an occurence
			// will occur every tuesday and another every friday
			// of every week (since the patterninterval we specified
			// was 1)
			//
			weekAppt.Recurrence.PatternDaysOfWeek = RecurrencePatternDaysOfWeek.Tuesday |
				RecurrencePatternDaysOfWeek.Friday;

			weekAppt.Subject = "A weekly recurrence that occurs Tuesday and Friday of every other week.";

			// For a calculated monthly recurrence, the 'PatternDaysOfWeek'
			// is used in conjuction with the 'PatternInterval' and
			// and 'PatternOccurrenceOfDayInMonth' to determine which
			// day of the month will be the start of each occurrence
			//

			// create a new appointment
			Appointment mthAppt = this.ultraCalendarInfo1.Appointments.Add(dt, dt.AddHours(3d), string.Empty);

			// create the recurrence object - this appointment
			// will become the rootappointment (or representation
			// of the series) - see above for more
			mthAppt.Recurrence = new AppointmentRecurrence();

			// this will be a monthly recurrence
			mthAppt.Recurrence.PatternFrequency = RecurrencePatternFrequency.Monthly;

			// the appointment will occur every other month so we specify
			// a patterninterval of 2
			mthAppt.Recurrence.PatternInterval = 2;

			// to have an appt occur based on a particular pattern (first, second, 
			// last, etc.) the patterntype must be set to calculated.
			mthAppt.Recurrence.PatternType = RecurrencePatternType.Calculated;
			
			// then you need to specify the calculatation. in this case, we want 
			// the last weekday in the month
			mthAppt.Recurrence.PatternOccurrenceOfDayInMonth = RecurrencePatternOccurrenceOfDayInMonth.Last;
			mthAppt.Recurrence.PatternDaysOfWeek = RecurrencePatternDaysOfWeek.AllWeekendDays;

			// we could have also specified a particular day
			// e.g.
			// appt.Recurrence.PatternDaysOfWeek = RecurrencePatternDaysOfWeek.Friday;

			// the description provides a description of the recurrence info
			mthAppt.Subject = mthAppt.Recurrence.Description;


			// For a calculated yearly recurrence, the 'PatternDaysOfWeek' is
			// used to determine which day of the month in the year
			// the occurrences will start.
			//

			// create a new appointment
			Appointment yrAppt = this.ultraCalendarInfo1.Appointments.Add(DateTime.Today, string.Empty);
			yrAppt.AllDayEvent = true;

			// create the recurrence object - this appointment
			// will become the rootappointment (or representation
			// of the series) - see above for more
			yrAppt.Recurrence = new AppointmentRecurrence();

			// this is a yearly occurrence
			yrAppt.Recurrence.PatternFrequency = RecurrencePatternFrequency.Yearly;

			// to have an appt occur based on a particular pattern (first, second, 
			// last, etc.) the patterntype must be set to calculated.
			yrAppt.Recurrence.PatternType = RecurrencePatternType.Calculated;

			// we are creating an appt for hanksgiving, which 
			// occurs on the 4th thursday of november so we'll
			// specify a 'PatternMonthOfYear' of 11 for november
			yrAppt.Recurrence.PatternMonthOfYear = 11;

			// its the fourth thursday so specify fourth...
			yrAppt.Recurrence.PatternOccurrenceOfDayInMonth = RecurrencePatternOccurrenceOfDayInMonth.Fourth;

			// and it falls on thursday...
			yrAppt.Recurrence.PatternDaysOfWeek = RecurrencePatternDaysOfWeek.Thursday;

			// the description provides a description of the recurrence info
			yrAppt.Subject = "Thanksgiving";
		}
参照