本文整理汇总了C#中Appointment.MoveTo方法的典型用法代码示例。如果您正苦于以下问题:C# Appointment.MoveTo方法的具体用法?C# Appointment.MoveTo怎么用?C# Appointment.MoveTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Appointment
的用法示例。
在下文中一共展示了Appointment.MoveTo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetNewByDayAppStartTime
/// <summary>
/// SetNewByDayAppStartTime
/// </summary>
/// <param name="app"></param>
/// <param name="dayOfWeek"></param>
/// <param name="byDay"></param>
private void SetNewByDayAppStartTime(
Appointment app, DayOfWeek dayOfWeek, int byDay)
{
DateTime date = app.StartTime.AddDays(-app.StartTime.Day + 1);
if (byDay >= 0)
{
while (date.DayOfWeek != dayOfWeek)
date = date.AddDays(1);
if (byDay > 0)
date = date.AddDays((byDay - 1) * 7);
}
else
{
date = date.AddMonths(1).AddDays(-1);
while (date.DayOfWeek != dayOfWeek)
date = date.AddDays(-1);
}
if (app.StartTime != date)
app.MoveTo(date);
}
示例2: AddYearlyByMonthDay
private void AddYearlyByMonthDay(CalendarModel model,
Appointment app, int byMonth, int byMonthDay, VEventData evData)
{
AppointmentRecurrence recur = new AppointmentRecurrence();
recur.RecurrenceType = eRecurrencePatternType.Yearly;
recur.Yearly.RepeatOnMonth = byMonth;
recur.Yearly.RepeatOnRelativeDayInMonth = eRelativeDayInMonth.None;
recur.Yearly.RepeatOnDayOfMonth = byMonthDay;
if (app.Recurrence != null)
{
app = app.Copy();
evData.UidApps.Add(app);
}
model.Appointments.Add(app);
int day = DateTime.DaysInMonth(app.StartTime.Year, byMonth);
if (day < byMonthDay)
byMonthDay = day;
DateTime startTime = new DateTime(app.StartTime.Year,
byMonth, byMonthDay, app.StartTime.Hour, app.StartTime.Minute, 0);
if (startTime < app.StartTime)
recur.SkippedRecurrences.Add(startTime);
if (app.StartTime != startTime)
app.MoveTo(startTime);
ProcessRecurrenceRange(app, recur, evData);
app.Recurrence = recur;
}