バージョン

PatternOccurrenceOfDayInMonth プロパティ (AppointmentRecurrence)

その月の1週目、2週目、3週目、4週目、または最後の週のうち、どの週の曜日 (PatternDaysOfWeek プロパティの値に対応) に繰り返し予定が発生するかを取得または設定します。
シンタックス
'宣言
 
Public Overrides Property PatternOccurrenceOfDayInMonth As RecurrencePatternOccurrenceOfDayInMonth
public override RecurrencePatternOccurrenceOfDayInMonth PatternOccurrenceOfDayInMonth {get; set;}
解説

注: PatternOccurrenceOfDayInMonth プロパティは、PatternFrequency プロパティが「Monthly」または「Yearly」に設定されている場合のみ適用されます。

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

    Private Sub CreateCalculatedMonthlyAndYearlyAppointments()
        ' The 'PatternOccurrenceOfDayInMonth' is used by
        ' calculated monthly and yearly (see PatternFrequency)
        ' recurrences.
        '

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

        ' create a new appointment
        Dim dt As DateTime = DateTime.Now
        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.AllWeekdays

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

        ' set the subject to provide a description of the recurrence info
        ' this will be the subject of all the occurrences until they
        ' are modified to become a variance.
        mthAppt.Subject = "A monthly recurrence that occurs the last weekday of every other month"


        ' For a calculated yearly recurrence, the 
        ' 'PatternOccurrenceOfDayInMonth' is used in conjunction
        ' with the 'PatternDaysOfWeek' and 'PatternMonthOfYear'
        ' to determine when each occurrence will begin.
        '

        ' create a new appointment
        Dim yrAppt As Appointment = Me.ultraCalendarInfo1.Appointments.Add(dt, 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 CreateCalculatedMonthlyAndYearlyAppointments()
		{
			// The 'PatternOccurrenceOfDayInMonth' is used by
			// calculated monthly and yearly (see PatternFrequency)
			// recurrences.
			//

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

			// create a new appointment
			DateTime dt = DateTime.Now;
			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.AllWeekdays;

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

			// set the subject to provide a description of the recurrence info
			// this will be the subject of all the occurrences until they
			// are modified to become a variance.
			mthAppt.Subject = "A monthly recurrence that occurs the last weekday of every other month";


			// For a calculated yearly recurrence, the 
			// 'PatternOccurrenceOfDayInMonth' is used in conjunction
			// with the 'PatternDaysOfWeek' and 'PatternMonthOfYear'
			// to determine when each occurrence will begin.
			//

			// create a new appointment
			Appointment yrAppt = this.ultraCalendarInfo1.Appointments.Add(dt, 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";
		}
参照