/// <summary> /// Initializes a new instance of the ScheduleRecurrence class. /// </summary> /// <param name="recurrenceType">The recurrence type. Possible values /// include: 'Minutes', 'Hourly', 'Daily', 'Weekly'</param> /// <param name="recurrenceValue">The recurrence value.</param> /// <param name="weeklyDaysList">The week days list. Applicable only /// for schedules of recurrence type 'weekly'.</param> public ScheduleRecurrence(RecurrenceType recurrenceType, int recurrenceValue, IList <DayOfWeek?> weeklyDaysList = default(IList <DayOfWeek?>)) { RecurrenceType = recurrenceType; RecurrenceValue = recurrenceValue; WeeklyDaysList = weeklyDaysList; CustomInit(); }
internal void Reset(RecurrenceType type) { switch (type) { case RecurrenceType.Daily: rinfo.Type = RecurrenceType.Daily; rinfo.WeekDays = WeekDays.EveryDay; break; case RecurrenceType.Weekly: rinfo.Type = RecurrenceType.Weekly; rinfo.WeekDays = DevExpress.XtraScheduler.Native.DateTimeHelper.ToWeekDays(rinfo.Start.DayOfWeek); break; case RecurrenceType.Monthly: rinfo.Type = RecurrenceType.Monthly; rinfo.WeekOfMonth = WeekOfMonth.None; rinfo.DayNumber = rinfo.Start.Day; break; case RecurrenceType.Yearly: rinfo.Type = RecurrenceType.Yearly; rinfo.WeekOfMonth = WeekOfMonth.None; rinfo.DayNumber = rinfo.Start.Day; rinfo.Month = rinfo.Start.Month; rinfo.WeekDays = DevExpress.XtraScheduler.Native.DateTimeHelper.ToWeekDays(rinfo.Start.DayOfWeek); break; } rinfo.Periodicity = 1; }
bool SetFreq(string type) { // FREQ parse switch (type) { case "DAILY": freq = RecurrenceType.Daily; break; case "WEEKLY": freq = RecurrenceType.Weekly; break; case "MONTHLY": freq = RecurrenceType.Monthly; break; case "YEARLY": freq = RecurrenceType.Yearly; break; default: HasError = true; ErrorMessage = "FREQ has non valid value " + type; return(false); } return(true); }
private void ReadRecurrencePattern(byte[] bytes) { AppointmentRecurrencePatternStructure structure = AppointmentRecurrencePatternStructure.GetRecurrencePatternStructure(bytes); m_startDTUtc = structure.GetStartDTUtc(this.OriginalTimeZone); m_duration = structure.Duration; RecurrenceType = structure.RecurrenceType; m_lastInstanceStartDate = structure.LastInstanceStartDate; Period = structure.PeriodInRecurrenceTypeUnits; if (structure.EndType == RecurrenceEndType.EndAfterNOccurrences) { EndAfterNumberOfOccurences = true; } switch (structure.RecurFrequency) { case RecurrenceFrequency.Daily: { break; } case RecurrenceFrequency.Weekly: { Day = (int)((WeeklyRecurrencePatternStructure)structure).DaysOfWeek; break; } case RecurrenceFrequency.Monthly: { if (structure.PatternType == PatternType.Month) { Day = (int)((MonthlyRecurrencePatternStructure)structure).DayOfMonth; } else // MonthNth { Day = (int)((MonthlyRecurrencePatternStructure)structure).DayOfWeek; DayOccurenceNumber = ((MonthlyRecurrencePatternStructure)structure).DayOccurenceNumber; } break; } case RecurrenceFrequency.Yearly: { if (structure.PatternType == PatternType.Month) { Day = (int)((YearlyRecurrencePatternStructure)structure).DayOfMonth; } else // MonthNth { Day = (int)((YearlyRecurrencePatternStructure)structure).DayOfWeek; DayOccurenceNumber = ((YearlyRecurrencePatternStructure)structure).DayOccurenceNumber; } } break; } DeletedInstanceDates = structure.DeletedInstanceDates; ExceptionList = structure.ExceptionList; }
public MyAppointmentEditForm(SchedulerControl control, Appointment apt, bool openRecurrenceForm, RecurrenceType type) : base(control, apt, openRecurrenceForm) { // 汉化 base.lblSubject.Text = "主题"; base.lblLocation.Text = "位置"; base.lblLabel.Text = "标签"; base.lblStartTime.Text = "开始时间"; base.lblEndTime.Text = "结束时间"; base.lblResource.Text = "负责人"; base.lblPercentComplete.Text = "完成百分比"; base.chkAllDay.Text = "全天任务"; base.btnRecurrence.Text = "重复设置"; // 布局 base.btnRecurrence.Visible = false; // 不能修改任务标题 if (!base.IsNewAppointment) { base.tbSubject.Enabled = false; } recurringType = type; }
public BudgetAdapter(Activity context, RecurrenceType type, DateTime date) { Context = context; Budgets = CashflowData.Budgets.Where(b => b.Recurrence?.Type == type).ToList(); switch (type) { case RecurrenceType.Daily: Transactions = CashflowData.Transactions.Where(t => t.Date.Day == date.Day); break; case RecurrenceType.Weekly: case RecurrenceType.Biweekly: // TODO fix this to actually be biweekly Transactions = CashflowData.Transactions.Where(t => AreFallingInSameWeek(t.Date, date, DayOfWeek.Monday)); break; case RecurrenceType.Monthly: Transactions = CashflowData.Transactions.Where(t => t.Date.Month == date.Month); break; case RecurrenceType.Quarterly: Transactions = CashflowData.Transactions.Where(t => GetQuarter(t.Date) == GetQuarter(date)); break; case RecurrenceType.Annually: Transactions = CashflowData.Transactions.Where(t => t.Date.Year == date.Year); break; default: Transactions = CashflowData.Transactions; break; } }
public CustomAppointmentForm(SchedulerControl control, Appointment apt, bool openRecurrenceForm, RecurrenceType type) : base(control, apt, openRecurrenceForm) { recurringType = type; InitializeComponent(); }
internal static uint ParseRecurrenceType(RecurrenceType type) { if (type == RecurrenceType.Daily) { return(1); } else if (type == RecurrenceType.Weekly) { return(2); } else if (type == RecurrenceType.Monthly) { return(3); } else if (type == RecurrenceType.Yearly) { return(4); } else if (type == RecurrenceType.MonthNth) { return(5); } else if (type == RecurrenceType.YearNth) { return(6); } else { return(0); } }
public static Recurrence CreateSpecificRecurringDate(RecurrenceType recurrenceType, DateTime startDate) { if (!recurrenceType.Equals(RecurrenceType.FixedDateAnnualRecurring) || !recurrenceType.Equals(RecurrenceType.DynamicDateRecurring)) { throw new ArgumentException("Incorrect recurrence type for this method", nameof(recurrenceType)); } return(new Recurrence(recurrenceType.DisplayName, startDate, 0, true)); }
protected override void SetRecurrenceType(RecurrenceType type) { if (type == RecurrenceType.Hourly && checkEdit1 != null) { checkEdit1.Checked = true; return; } base.SetRecurrenceType(type); }
private static RecurrenceType CreateRecurrence(RecurrenceRule schedulerRule, RadScheduler owner) { RecurrenceType recurrence = new RecurrenceType(); recurrence.Item = RecurrencePatternBaseType.CreateFromSchedulerRecurrencePattern(schedulerRule.Pattern); recurrence.Item1 = RecurrenceRangeBaseType.CreateFromSchedulerRecurrenceRule(schedulerRule, owner); return(recurrence); }
public Recurrence GetRecurrence(RecurrenceType type) { switch (type) { case Daily: return(new DailyRecurrence); : } }
public Recurrence(RecurrenceType type, uint interval, uint nthDayInMonth, DaysOfWeek daysOfWeek, WeekOrderInMonth weekOrderInMonth, uint monthOrder) { this.Type = type; this.Interval = interval; this.NthDayInMonth = nthDayInMonth; this.DaysOfWeek = daysOfWeek; this.WeekOrderInMonth = weekOrderInMonth; this.MonthOrder = monthOrder; }
/// <summary> /// Initializes a new instance of the ScheduleRecurrenceWeekly class /// with required arguments. /// </summary> public ScheduleRecurrenceWeekly(List<DayOfWeek> weekDays, RecurrenceType recurrenceType, int recurrenceValue) : this() { if (weekDays == null) { throw new ArgumentNullException("weekDays"); } this.WeekDays = weekDays; this.RecurrenceType = recurrenceType; this.RecurrenceValue = recurrenceValue; }
/// <summary> /// Initializes a new instance of the ScheduleRecurrenceWeekly class /// with required arguments. /// </summary> public ScheduleRecurrenceWeekly(List <DayOfWeek> weekDays, RecurrenceType recurrenceType, int recurrenceValue) : this() { if (weekDays == null) { throw new ArgumentNullException("weekDays"); } this.WeekDays = weekDays; this.RecurrenceType = recurrenceType; this.RecurrenceValue = recurrenceValue; }
public Recurrence(RecurrenceType type, uint value) { if (type == RecurrenceType.Single && value != 0) { throw new ArgumentException( $"Type is {type.ToString()}, so value cannot be {value}."); } this.type = type; this.value = value; }
private EventRecurrence(RecurrenceType type, int interval, short month, short dayOfMonth, RecurrenceDays dayOfWeekMask, short instance, string startDatePattern, string endDatePattern, bool noEndDate) { this.type = type; this.interval = interval; this.month = month; this.dayOfMonth = dayOfMonth; this.dayOfWeekMask = dayOfWeekMask; this.instance = instance; this.startDatePattern = startDatePattern; this.endDatePattern = endDatePattern; this.noEndDate = noEndDate; }
public static Recurrence CreateUserSpecificNonRecurringDate(User user, RecurrenceType recurrenceType, DateTime startDate) { if (recurrenceType.Equals(RecurrenceType.HireDateRecurring)) { return(new Recurrence(recurrenceType.DisplayName, user.HireDate, 0, false)); } if (recurrenceType.Equals(RecurrenceType.BirthDateRecurring)) { return(new Recurrence(recurrenceType.DisplayName, user.DOB, 0, false)); } throw new ArgumentException("Incorrect recurrence type for this method", nameof(recurrenceType)); }
public DateTime CalculateEventEndDate(DateTime startDate, DateTime?endDate, RecurrenceType recurrenceType, int interval, int duration, int?occurences, FrequencyType frequencyType, List <DayOfWeek> days) { switch (recurrenceType) { case RecurrenceType.Infinite: return(DateTime.MaxValue); case RecurrenceType.Occurrence: return(CalculateOccurrenceEndDate(startDate, duration, interval, occurences.Value, frequencyType, days)); case RecurrenceType.TillDate: case RecurrenceType.None: default: return(endDate.Value); } }
public override string GetStepParameters() { var parameters = new List <string>(); parameters.Add(RecurrenceType.ToStepValue()); parameters.Add(DayComponent != null ? DayComponent.ToStepValue() : "$"); parameters.Add(WeekdayComponent != null ? WeekdayComponent.ToStepValue() : "$"); parameters.Add(MonthComponent != null ? MonthComponent.ToStepValue() : "$"); parameters.Add(Position != null ? Position.ToStepValue() : "$"); parameters.Add(Interval != null ? Interval.ToStepValue() : "$"); parameters.Add(Occurrences != null ? Occurrences.ToStepValue() : "$"); parameters.Add(TimePeriods != null ? TimePeriods.ToStepValue() : "$"); return(string.Join(", ", parameters.ToArray())); }
/// <summary> /// Returns true if CreateMandateBase instances are equal /// </summary> /// <param name="other">Instance of CreateMandateBase to be compared</param> /// <returns>Boolean</returns> public bool Equals(CreateMandateBase other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( Alias == other.Alias || Alias != null && Alias.Equals(other.Alias) ) && ( Customer == other.Customer || Customer != null && Customer.Equals(other.Customer) ) && ( CustomerReference == other.CustomerReference || CustomerReference != null && CustomerReference.Equals(other.CustomerReference) ) && ( Language == other.Language || Language != null && Language.Equals(other.Language) ) && ( RecurrenceType == other.RecurrenceType || RecurrenceType != null && RecurrenceType.Equals(other.RecurrenceType) ) && ( SignatureType == other.SignatureType || SignatureType != null && SignatureType.Equals(other.SignatureType) ) && ( UniqueMandateReference == other.UniqueMandateReference || UniqueMandateReference != null && UniqueMandateReference.Equals(other.UniqueMandateReference) )); }
protected override void RenderItemMetaDataExpandos(TextWriter writer) { base.RenderItemMetaDataExpandos(writer); if (this.IsAssignedTask) { writer.Write(" fAT=1"); } bool itemProperty = this.DataSource.GetItemProperty <bool>(TaskSchema.IsTaskRecurring, false); if (itemProperty) { writer.Write(" fRT=1"); } RecurrenceType itemProperty2 = this.DataSource.GetItemProperty <RecurrenceType>(TaskSchema.RecurrenceType, RecurrenceType.None); if (TaskUtilities.IsRegeneratingRecurrenceType(itemProperty2)) { writer.Write(" fRgT=1"); } ExDateTime itemProperty3 = this.DataSource.GetItemProperty <ExDateTime>(TaskSchema.DueDate, ExDateTime.MinValue); ExDateTime date = DateTimeUtilities.GetLocalTime().Date; if (itemProperty3 > ExDateTime.MinValue && itemProperty3.Date < date) { writer.Write(" fOD=1"); } ExDateTime date2 = (itemProperty3 > ExDateTime.MinValue) ? itemProperty3 : date; writer.Write(" dtDD=\""); writer.Write(DateTimeUtilities.GetJavascriptDate(date2)); writer.Write("\""); Importance itemProperty4 = this.DataSource.GetItemProperty <Importance>(ItemSchema.Importance, Importance.Normal); writer.Write(" iI="); writer.Write((int)itemProperty4); base.RenderFlagState(writer); bool itemProperty5 = this.DataSource.GetItemProperty <bool>(StoreObjectSchema.IsRestricted, false); if (itemProperty5 && base.UserContext.IsIrmEnabled) { ContentRight itemProperty6 = (ContentRight)this.DataSource.GetItemProperty <int>(MessageItemSchema.DRMRights, 0); RenderingUtilities.RenderExpando(writer, "fRplR", itemProperty6.IsUsageRightGranted(ContentRight.Reply) ? 0 : 1); RenderingUtilities.RenderExpando(writer, "fRAR", itemProperty6.IsUsageRightGranted(ContentRight.ReplyAll) ? 0 : 1); RenderingUtilities.RenderExpando(writer, "fFR", itemProperty6.IsUsageRightGranted(ContentRight.Forward) ? 0 : 1); } base.RenderMeetingRequestExpandos(writer); }
/// <summary> /// Create Schedule for a Backup /// </summary> private BackupSchedule CreateBackupSchedule( string deviceName, string backupPolicyName, string name, RecurrenceType recurrenceType, DateTime startTime) { // Initialize defaults ScheduleStatus scheduleStatus = ScheduleStatus.Enabled; int recurrenceValue = 1; long retentionCount = 1; List <SSModels.DayOfWeek> weeklyDays = new List <SSModels.DayOfWeek>() { SSModels.DayOfWeek.Friday, SSModels.DayOfWeek.Thursday, SSModels.DayOfWeek.Monday }; var schedule = new BackupSchedule() { BackupType = BackupType.CloudSnapshot, Kind = Kind.Series8000, RetentionCount = retentionCount, ScheduleStatus = scheduleStatus, StartTime = startTime, ScheduleRecurrence = new ScheduleRecurrence( recurrenceType, recurrenceValue) }; // Set the week days for the weekly schedule if (schedule.ScheduleRecurrence.RecurrenceType == RecurrenceType.Weekly) { schedule.ScheduleRecurrence.WeeklyDaysList = weeklyDays.Select(d => (SSModels.DayOfWeek?)d).ToList(); } return(this.Client.BackupSchedules.CreateOrUpdate( deviceName.GetDoubleEncoded(), backupPolicyName.GetDoubleEncoded(), name.GetDoubleEncoded(), schedule, this.ResourceGroupName, this.ManagerName)); }
protected int _getSeriesStep(RecurrenceType type) { switch (type) { case RecurrenceType.Daily: return(1); case RecurrenceType.Weekly: return(7); case RecurrenceType.Monthly: return(1); case RecurrenceType.Yearly: return(12); } return(1); }
public static Frequency FromUtcDateTime(DateTime utcRunTime, RecurrenceType recurrence, TimeZoneInfo clientTimeZone) { if (clientTimeZone == null) { throw new ArgumentNullException(nameof(clientTimeZone)); } var clientRunTime = TimeZoneInfo.ConvertTime(utcRunTime, TimeZoneInfo.Utc, clientTimeZone); var result = new Frequency { ClientTimeZone = clientTimeZone, UtcRunTime = new DateTime(utcRunTime.Year, utcRunTime.Month, utcRunTime.Day, utcRunTime.Hour, utcRunTime.Minute, 0, DateTimeKind.Utc), ClientRunTime = new DateTime(clientRunTime.Year, clientRunTime.Month, clientRunTime.Day, clientRunTime.Hour, clientRunTime.Minute, 0, DateTimeKind.Unspecified), Recurrence = recurrence }; return(result); }
internal static string ToSerializedValue(this RecurrenceType value) { switch (value) { case RecurrenceType.Minutes: return("Minutes"); case RecurrenceType.Hourly: return("Hourly"); case RecurrenceType.Daily: return("Daily"); case RecurrenceType.Weekly: return("Weekly"); } return(null); }
void ClearValues() { hasFreq = false; hasCount = false; hasUntil = false; hasByDay = false; hasByMonthDay = false; hasByMonth = false; hasBySetPos = false; freq = RecurrenceType.Daily; interval = 1; count = 0; until = DateTime.MinValue; byDay = new List <string>(); byMonthDay = 0; byMonth = 0; bySetPos = 0; }
public MyAppointmentRecurrenceForm(Appointment pattern, FirstDayOfWeek firstDayOfWeek, AppointmentFormControllerBase controller, RecurrenceType type) : base(pattern, firstDayOfWeek, controller) { base.dailyRecurrenceControl1.Enabled = false; base.weeklyRecurrenceControl1.Enabled = false; base.monthlyRecurrenceControl1.Enabled = false; base.yearlyRecurrenceControl1.Enabled = false; switch (type) { case RecurrenceType.Daily: base.dailyRecurrenceControl1.Enabled = true; break; // Code for other RecurrenceType cases if required. } base.grpRecurrencePattern.Text = "You can edit only daily recurring appointments"; base.Text = "Appointment Recurrence: Modified Form"; }
protected RecurrenceRuleControlBase GetCurrentRecurrenceRuleControl() { RecurrenceType type = edtRecurrenceTypeEdit.Type; switch (type) { case RecurrenceType.Weekly: return(edtWeeklyRecurrenceControl); case RecurrenceType.Monthly: return(edtMonthlyRecurrenceControl); case RecurrenceType.Yearly: return(edtYearlyRecurrenceControl); case RecurrenceType.Daily: default: return(edtDailyRecurrenceControl); } }
protected virtual void SetRecurrenceType(RecurrenceType type) { switch (type) { case RecurrenceType.Daily: radioGroup1.EditValue = "Daily"; break; case RecurrenceType.Weekly: radioGroup1.EditValue = "Weekly"; break; case RecurrenceType.Monthly: radioGroup1.EditValue = "Monthly";; break; case RecurrenceType.Yearly: radioGroup1.EditValue = "Yearly"; break; } }
private string Write8_RecurrenceType(RecurrenceType v) { string result; switch (v) { case RecurrenceType.Unknown: result = "Unknown"; break; case RecurrenceType.Daily: result = "Daily"; break; case RecurrenceType.Weekly: result = "Weekly"; break; case RecurrenceType.Monthly: result = "Monthly"; break; case RecurrenceType.MonthlyTh: result = "MonthlyTh"; break; case RecurrenceType.Yearly: result = "Yearly"; break; case RecurrenceType.YearlyTh: result = "YearlyTh"; break; default: throw base.CreateInvalidEnumValueException(((long)v).ToString(CultureInfo.InvariantCulture), "Microsoft.Exchange.Data.Storage.VersionedXml.RecurrenceType"); } return(result); }
/// <summary> /// Initializes a new instance of the ScheduleRecurrence class with /// required arguments. /// </summary> public ScheduleRecurrence(RecurrenceType recurrenceType, int recurrenceValue) : this() { this.RecurrenceType = recurrenceType; this.RecurrenceValue = recurrenceValue; }
public IQueryable<Recurrence> GetRecurrences(string username, RecurrenceType recurrenceType) { return GetRecurrences(r => r.Category.Owner.Username == username && r.Type == recurrenceType); }
public IQueryable<Recurrence> GetRecurrences(int ownerId, RecurrenceType recurrenceType) { return GetRecurrences(r => r.Category.OwnerId == ownerId && r.Type == recurrenceType); }