当前位置: 首页>>代码示例>>C#>>正文


C# Appointment.MoveTo方法代码示例

本文整理汇总了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);
        }
开发者ID:huamanhtuyen,项目名称:VNACCS,代码行数:30,代码来源:IcsImporter.cs

示例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;
        }
开发者ID:huamanhtuyen,项目名称:VNACCS,代码行数:38,代码来源:IcsImporter.cs


注:本文中的Appointment.MoveTo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。