Class ByMonthWeekDayRepetition

ByMonthWeekDayRepetition class

Represents a pattern which is based on the position of weekday in a month.

public class ByMonthWeekDayRepetition : MonthlyRepetitionBase

Constructors

NameDescription
ByMonthWeekDayRepetition()Initializes a new instance of the ByMonthWeekDayRepetition class.

Properties

NameDescription
Position { get; set; }Gets or sets a position of weekday in a month on which the task must be recurring.
RepetitionInterval { get; set; }Gets or sets a number of month which represents the interval in months between occurrences.
WeekDay { get; set; }Gets or sets a type of weekday on which the task must be recurring.

Examples

Shows how to work with month weekday repetitions while create a new recurring tasks.

var project = new Project(DataDir + "Project1.mpp");
var parameters = new RecurringTaskParameters
                     {
                         TaskName = "t1",
                         Duration = project.GetDuration(1, TimeUnitType.Day),
                         RecurrencePattern = new MonthlyRecurrencePattern
                                                 {
                                                     Repetition = new ByMonthWeekDayRepetition
                                                                      {
                                                                          Position = OrdinalNumber.First,
                                                                          WeekDay = DayOfWeek.Sunday,
                                                                          RepetitionInterval = 2
                                                                      },
                                                     RecurrenceRange = new EndByRecurrenceRange
                                                                           {
                                                                               Start = new DateTime(2018, 7, 1, 8, 0, 0),
                                                                               Finish = new DateTime(2018, 9, 2, 17, 0, 0)
                                                                           }
                                                 }
                     };
project.RootTask.Children.Add(parameters);
project.Save(OutDir + "CanAddRecurringTask_Months_WeekDay_EndByRecurrenceRange_Test_out.mpp", SaveFileFormat.Mpp);

See Also