/// <summary> /// This is used by the recurrence pattern control to update the current frequency when the radio buttons /// selection changes. /// </summary> /// <param name="frequency">The new frequency</param> public void SetFrequency(RecurFrequency frequency) { rf = frequency; // Set the interval label and enable or disable the ByDay instance control based on the frequency switch (rf) { case RecurFrequency.Yearly: // Day instance is disabled if ByMonth and ByMonthDay are use together or if ByWeekNo is used if (lbByMonth.CheckedItems.Count > 0) { udcDayInstance.Enabled = (txtByMonthDay.Text.Length == 0); } else { udcDayInstance.Enabled = (txtByWeekNo.Text.Length == 0); } lblInterval.Text = LR.GetString("APYearly"); break; case RecurFrequency.Monthly: // Day instance is disabled if ByMonthDay is specified udcDayInstance.Enabled = (txtByMonthDay.Text.Length == 0); lblInterval.Text = LR.GetString("APMonthly"); break; case RecurFrequency.Weekly: udcDayInstance.Enabled = false; lblInterval.Text = LR.GetString("APWeekly"); break; case RecurFrequency.Daily: udcDayInstance.Enabled = false; lblInterval.Text = LR.GetString("APDaily"); break; case RecurFrequency.Hourly: udcDayInstance.Enabled = false; lblInterval.Text = LR.GetString("APHourly"); break; case RecurFrequency.Minutely: udcDayInstance.Enabled = false; lblInterval.Text = LR.GetString("APMinutely"); break; case RecurFrequency.Secondly: udcDayInstance.Enabled = false; lblInterval.Text = LR.GetString("APSecondly"); break; } LoadByDayValues(); // By Week # is only used by the Yearly frequency txtByWeekNo.Enabled = (rf == RecurFrequency.Yearly); }
//===================================================================== /// <summary> /// Constructor /// </summary> public RecurrencePattern() { InitializeComponent(); weekStartDayVisible = holidayVisible = advancedVisible = true; maxPattern = RecurFrequency.Secondly; cboWeekStartDay.DisplayMember = "Display"; cboWeekStartDay.ValueMember = "Value"; cboWeekStartDay.DataSource = RecurOptsDataSource.DayOfWeek; this.ShowEndTime = true; SetRecurrence(null); }
/// <summary> /// This is used by the recurrence pattern control to update the current frequency when the radio buttons /// selection changes. /// </summary> /// <param name="frequency">The new frequency</param> public void SetFrequency(RecurFrequency frequency) { rf = frequency; // Set the interval label and enable or disable the ByDay instance control based on the frequency switch(rf) { case RecurFrequency.Yearly: // Day instance is disabled if ByMonth and ByMonthDay are use together or if ByWeekNo is used if(lbByMonth.CheckedItems.Count > 0) udcDayInstance.Enabled = (txtByMonthDay.Text.Length == 0); else udcDayInstance.Enabled = (txtByWeekNo.Text.Length == 0); lblInterval.Text = LR.GetString("APYearly"); break; case RecurFrequency.Monthly: // Day instance is disabled if ByMonthDay is specified udcDayInstance.Enabled = (txtByMonthDay.Text.Length == 0); lblInterval.Text = LR.GetString("APMonthly"); break; case RecurFrequency.Weekly: udcDayInstance.Enabled = false; lblInterval.Text = LR.GetString("APWeekly"); break; case RecurFrequency.Daily: udcDayInstance.Enabled = false; lblInterval.Text = LR.GetString("APDaily"); break; case RecurFrequency.Hourly: udcDayInstance.Enabled = false; lblInterval.Text = LR.GetString("APHourly"); break; case RecurFrequency.Minutely: udcDayInstance.Enabled = false; lblInterval.Text = LR.GetString("APMinutely"); break; case RecurFrequency.Secondly: udcDayInstance.Enabled = false; lblInterval.Text = LR.GetString("APSecondly"); break; } LoadByDayValues(); // By Week # is only used by the Yearly frequency txtByWeekNo.Enabled = (rf == RecurFrequency.Yearly); }