• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# ISchedule类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ISchedule的典型用法代码示例。如果您正苦于以下问题:C# ISchedule类的具体用法?C# ISchedule怎么用?C# ISchedule使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ISchedule类属于命名空间,在下文中一共展示了ISchedule类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: MovingVoyage

		public MovingVoyage (VoyageNumber number, ISchedule schedule, int movementIndex)
			: base(number, schedule)
		{
			if(movementIndex < 0 || movementIndex >= schedule.MovementsCount)
				throw new ArgumentOutOfRangeException("movementIndex");
			_movementIndex = movementIndex;
		}
开发者ID:hungdluit,项目名称:Epic.NET,代码行数:7,代码来源:MovingVoyage.cs


示例2: GetFineOfAddedClass

 public int GetFineOfAddedClass(ISchedule schedule, EntityStorage eStorage)
 {
     int fineCount = 0;
     if (lClasses == null)
     { return fineCount; }
     int classTime = schedule.GetTimeOfTempClass();
     int dayOfWeek = Constants.GetDayOfClass(classTime);
     int lectureCount = 0;
     foreach (StudentSubGroup subGroup in schedule.GetTempClass().SubGroups)
     {
         lectureCount = CountLectureClassesInDay(schedule.GetPartialSchedule(subGroup).GetClassesOfDay(dayOfWeek), lClasses);
         if (lectureCount > 3)
         {
             fineCount++;
         }
     }
     if (fineCount != 0)
     {
         if (isBlock)
             return Constants.BLOCK_FINE;
         else
             return fineCount * fine;
     }
     return fineCount;
 }
开发者ID:Eugenni,项目名称:mandarin,代码行数:25,代码来源:LectureClassesInDay.cs


示例3: LotOfClassesInWeek

 public static bool LotOfClassesInWeek(int maxCountClassesInWeek, StudentsClass[,] sClasses, ISchedule schedule, StudentsClass specialClass)
 {
     int rowClass = -1;
     //если пара есть в списке "особых пар" - получаю номер строки, в которой располагаются другие "особые" пары
     if ((rowClass = GetRow(sClasses, specialClass)) != -1)
     {
         int weekCount1 = 0; //количество "особых" пар из полученной строки, поставленных на первую неделю
         int weekCount2 = 0; //количество "особых" пар из полученной строки, поставленных на вторую неделю
         for (int classIndex = 0; classIndex < sClasses.GetLength(1); classIndex++)
         {
             if (sClasses[rowClass, classIndex] == null)
                 continue;
             StudentsClassPosition? position = schedule.GetClassPosition(sClasses[rowClass, classIndex]);
             if (position.HasValue)//если пара установлена
             {
                 if (Constants.GetWeekOfClass(position.Value.Time) == 0)//если пара располагается на первой неделе
                     weekCount1++;
                 else//на второй
                     weekCount2++;
             }
         }
         if (weekCount1 > maxCountClassesInWeek || weekCount2 > maxCountClassesInWeek)
         {
             return true;
         }
     }
     return false;
 }
开发者ID:Kirk7by,项目名称:mandarin,代码行数:28,代码来源:ClassesInWeek.cs


示例4: GetFineOfAddedClass

 public int GetFineOfAddedClass(ISchedule schedule, EntityStorage eStorage)
 {
     int fineResult = 0;
     StudentsClass tempClass = schedule.GetTempClass();
     int classTime = schedule.GetTimeOfTempClass();
     int roomIndex = schedule.GetClassPosition(schedule.GetTempClass()).Value.ClassRoom;
     int weekOfClass = Constants.GetWeekOfClass(classTime);
     if (Array.Find(sClassesList.ToArray(), (c) => c == schedule.GetTempClass()) != null)
     {
         StudentsClass secondClass;
         if (weekOfClass == 0)
             secondClass = schedule.GetClassByRoomAndPosition(roomIndex, classTime + Constants.CLASSES_IN_DAY * Constants.DAYS_IN_WEEK);
         else
             secondClass = schedule.GetClassByRoomAndPosition(roomIndex, classTime - Constants.CLASSES_IN_DAY * Constants.DAYS_IN_WEEK);
         if (secondClass != null)
         {
             int firstClassRow = ClassesInWeek.GetRow(sClasses, tempClass);
             int secondClassRow = ClassesInWeek.GetRow(sClasses, secondClass);
             if (secondClassRow == -1 || secondClassRow != firstClassRow)
             {
                 if (isBlock)
                     return Constants.BLOCK_FINE;
                 else
                     fineResult += fine;
             }
         }
     }
     return fineResult;
 }
开发者ID:Kirk7by,项目名称:mandarin,代码行数:29,代码来源:PairClassesInSameRoom.cs


示例5: GetFineOfFullSchedule

 public int GetFineOfFullSchedule(ISchedule schedule, EntityStorage eStorage)
 {
     int fineResult = 0;
     for (int groupIndex = 0; groupIndex < eStorage.StudentSubGroups.Length; groupIndex++)
     {
         PartialSchedule groupSchedule = schedule.GetPartialSchedule(eStorage.StudentSubGroups[groupIndex]);
         for (int dayIndex = 0; dayIndex < Constants.DAYS_IN_WEEK; dayIndex++)
         {
             StudentsClass[] sClass = groupSchedule.GetClassesOfDay(dayIndex);
             for (int classIndex = 0; classIndex < sClass.Length; classIndex++)
             {
                 if (sClasses.FindAll((c) => c.sClass == sClass[classIndex]).Count() > 0)
                 {
                     FixedClasses vipClass = sClasses.Find((c) => c.sClass == sClass[classIndex]);
                     if (vipClass.Room != schedule.GetClassRoom(sClass[classIndex]) && vipClass.Time != schedule.GetClassPosition(sClass[classIndex]).Value.Time)
                     {
                         if (isBlock)
                             return Constants.BLOCK_FINE;
                         else
                             fineResult += fine;
                     }
                 }
             }
         }
     }
     return fineResult;
 }
开发者ID:Kirk7by,项目名称:mandarin,代码行数:27,代码来源:VIPClasses.cs


示例6: GetFineOfAddedClass

 public int GetFineOfAddedClass(ISchedule schedule, EntityStorage eStorage)
 {
     StudentSubGroup[] groups = schedule.GetTempClass().SubGroups;
     int fineResult = 0;
     if (IsSaturday(Constants.GetDayOfClass(schedule.GetTimeOfTempClass())))
     {
         for (int groupIndex = 0; groupIndex < groups.Length; groupIndex++)
         {
             PartialSchedule groupSchedule = schedule.GetPartialSchedule(groups[groupIndex]);
             int day = Constants.GetDayOfClass(schedule.GetTimeOfTempClass());
             if (Array.FindAll<StudentsClass>(groupSchedule.GetClassesOfDay(day), (c) => c != null).Count() > 0)
             {
                 if (isBlock)
                     return Constants.BLOCK_FINE;
                 else
                     fineResult += fine;
             }
         }
     }
     else
     {
         return 0;
     }
     return fineResult;
 }
开发者ID:Kirk7by,项目名称:mandarin,代码行数:25,代码来源:SaturdayClass.cs


示例7: GetFineOfAddedClass

 public int GetFineOfAddedClass(ISchedule schedule, EntityStorage eStorage)
 {
     int fineResult = 0;
     StudentsClass tClass = schedule.GetTempClass();
     int tTime = schedule.GetClassPosition(tClass).Value.Time;
     if (sClasses.FindAll((c) => c.sClass == tClass).Count() > 0)
     {
         FixedClasses vipClass = sClasses.Find((c) => c.sClass == tClass);
         if (vipClass.Room != schedule.GetClassRoom(tClass) || vipClass.Time != tTime)
         {
             if (isBlock)
                 return Constants.BLOCK_FINE;
             else
                 fineResult += fine;
         }
     }
     else
     {
         if (sClasses.FindAll((c) => c.Time == tTime && StudentsClass.StudentClassContainsEvenOneSubGroup(tClass, c.sClass)).Count() > 0)
         {
             if (isBlock)
                 return Constants.BLOCK_FINE;
             else
                 fineResult += fine;
         }
     }
     return fineResult;
 }
开发者ID:Kirk7by,项目名称:mandarin,代码行数:28,代码来源:VIPClasses.cs


示例8: GetFineOfFullSchedule

 public int GetFineOfFullSchedule(ISchedule schedule, EntityStorage eStorage)
 {
     int fineResult = 0;
     foreach (StudentSubGroup subGroup in eStorage.StudentSubGroups)
     {
         for (int dayIndex = 0; dayIndex < Constants.DAYS_IN_WEEK; dayIndex++)
         {
             StudentsClass[] subGroupDay = schedule.GetPartialSchedule(subGroup).GetClassesOfDay(dayIndex);
             for (int classIndex = 0; classIndex < subGroupDay.Length; classIndex++)
             {
                 if (Array.Find<StudentsClass>(sClassesList.ToArray(), (c) => c == subGroupDay[classIndex]) != null)
                 {
                     StudentsClassPosition? firstClassPosition = schedule.GetClassPosition(subGroupDay[classIndex]);
                     StudentsClass secondClass = schedule.GetClassByRoomAndPosition(firstClassPosition.Value.ClassRoom,
                         firstClassPosition.Value.Time + Constants.CLASSES_IN_DAY * Constants.DAYS_IN_WEEK);
                     if (secondClass != null)
                     {
                         int firstClassRow = ClassesInWeek.GetRow(sClasses, subGroupDay[classIndex]);
                         int secondClassRow = ClassesInWeek.GetRow(sClasses, secondClass);
                         if (secondClassRow == -1 || secondClassRow != firstClassRow)
                         {
                             if (isBlock)
                                 return Constants.BLOCK_FINE;
                             else
                                 fineResult += fine;
                         }
                     }
                 }
             }
         }
     }
     return fineResult;
 }
开发者ID:Kirk7by,项目名称:mandarin,代码行数:33,代码来源:PairClassesInSameRoom.cs


示例9: ScheduleJob

 public void ScheduleJob(string jobName, ISchedule schedule, Action action)
 {
     var jobDetail = new JobDetailImpl(jobName, typeof (ActionJob));
     jobDetail.JobDataMap[ActionJob.ActionParamName] = action;
     _quartzScheduler.ScheduleJob(jobDetail, ((TriggerWrapper) schedule).QuartzTrigger);
     _quartzScheduler.Start();
 }
开发者ID:qrunner,项目名称:qproject,代码行数:7,代码来源:SchedulerWrapper.cs


示例10: ClassesAtSameTime

 public static bool ClassesAtSameTime(ISchedule schedule, int classRow, StudentsClass[,] sClasses)
 {
     StudentsClassPosition? firstClassPosition = schedule.GetClassPosition(sClasses[classRow, 0]);
     StudentsClassPosition? secondClassPosition = schedule.GetClassPosition(sClasses[classRow, 1]);
     if (firstClassPosition.HasValue && secondClassPosition.HasValue)
     {
         if (firstClassPosition.Value.Time > secondClassPosition.Value.Time)
         {
             if (secondClassPosition.Value.Time + Constants.CLASSES_IN_DAY * Constants.DAYS_IN_WEEK
                 != firstClassPosition.Value.Time)
             {
                 return false;
             }
         }
         else if (secondClassPosition.Value.Time > firstClassPosition.Value.Time)
         {
             if (firstClassPosition.Value.Time + Constants.CLASSES_IN_DAY * Constants.DAYS_IN_WEEK
                 != secondClassPosition.Value.Time)
             {
                 return false;
             }
         }
     }
     return true;
 }
开发者ID:Kirk7by,项目名称:mandarin,代码行数:25,代码来源:SameClasses.cs


示例11: GetFineOfFullSchedule

        public int GetFineOfFullSchedule(ISchedule schedule, EntityStorage eStorage)
        {
            int fineResult = 0;
            if (sClasses == null)
            { return fineResult; }
            for (int groupIndex = 0; groupIndex < eStorage.StudentSubGroups.Length; groupIndex++)
            {
                PartialSchedule groupSchedule = schedule.GetPartialSchedule(eStorage.StudentSubGroups[groupIndex]);
                for (int dayIndex = 0; dayIndex < Constants.WEEKS_IN_SCHEDULE * Constants.DAYS_IN_WEEK; dayIndex++)
                {
                    for (int classIndex = 0; classIndex < Constants.CLASSES_IN_DAY; classIndex++)
                    {
                        if (!SameClasses.ClassAtTheSameTimeOnOtherWeek(schedule, sClasses, dayIndex, classIndex))
                        {
                            if (isBlock)
                                return Constants.BLOCK_FINE;
                            else
                                fineResult += fine;
                        }

                    }
                }
            }
            return fineResult;
        }
开发者ID:Eugenni,项目名称:mandarin,代码行数:25,代码来源:ClassInSameTimeOnOtherWeek.cs


示例12: ClassAtTheSameTimeOnOtherWeek

 public static bool ClassAtTheSameTimeOnOtherWeek(ISchedule schedule, StudentsClass[] sClasses, int dayOfWeek, int classOfDay)
 {
     StudentsClass tempClass = schedule.GetTempClass();
     if (dayOfWeek < Constants.DAYS_IN_WEEK)
     {
         foreach (StudentSubGroup subGroup in tempClass.SubGroups)
         {
             StudentsClass secondClass = schedule.GetPartialSchedule(subGroup).GetClassesOfDay(dayOfWeek + Constants.DAYS_IN_WEEK)[classOfDay];
             if (!IsSameClassesAtTheSameTimeOnOtherWeek(sClasses, tempClass, secondClass))
             {
                 return false;
             }
         }
     }
     else
     {
         foreach (StudentSubGroup subGroup in tempClass.SubGroups)
         {
             StudentsClass secondClass = schedule.GetPartialSchedule(subGroup).GetClassesOfDay(dayOfWeek - Constants.DAYS_IN_WEEK)[classOfDay];
             if (!IsSameClassesAtTheSameTimeOnOtherWeek(sClasses, tempClass, secondClass))
             {
                 return false;
             }
         }
     }
     return true;
 }
开发者ID:Kirk7by,项目名称:mandarin,代码行数:27,代码来源:SameClasses.cs


示例13: DeleteSchedule

 public void DeleteSchedule(ISchedule schedule)
 {
     lock (_schedulesSyncro)
     {
         _schedules.Remove(schedule);
     }
 }
开发者ID:maxrogoz,项目名称:COSystemArchitect,代码行数:7,代码来源:Scheduler.cs


示例14: GetFineOfFullSchedule

        public int GetFineOfFullSchedule(ISchedule schedule, EntityStorage eStorage)
        {
            int lectureCount = 0;
            int fineCount = 0;
            foreach (StudentSubGroup subGroup in eStorage.StudentSubGroups)
            {
                for (int dayIndex = 0; dayIndex < Constants.DAYS_IN_WEEK * Constants.WEEKS_IN_SCHEDULE; dayIndex++)
                {

                    lectureCount = CountLectureClassesInDay(schedule.GetPartialSchedule(subGroup).GetClassesOfDay(dayIndex), lClasses);
                    if (lectureCount > 3)
                    {
                        fineCount++;
                    }
                }
            }
            if (fineCount != 0)
            {
                if (isBlock)
                    return Constants.BLOCK_FINE;
                else
                    return fineCount * fine;
            }
            return fineCount;
        }
开发者ID:Kirk7by,项目名称:mandarin,代码行数:25,代码来源:LectureClassesInDay.cs


示例15: AdvancedPrint

        private IScheduleVisitor AdvancedPrint(ISchedule schedule)
        {
            // Now try using our custom formatter to generate the description using the Description property.
            // Using our custom formatter will now produce different text saying "Fortnightly" instead of 
            // the standard "Every 2 weeks"
            var formatter = new CustomFormatter(DateTime.Now);

            // there are three options when using the formatter:
            // 1) handle the description changed event, which will be fired each time a schedule
            //    accepts the formatter (good for looping over lists of schedules), or
            // 2) if it's only called for one schedule, use formatter.Description after it's been
            //    accepted as this property will have the last Description generated, or
            // 3) call formatter.Format() if you know the type of your schedule object.
            formatter.DescriptionChanged += (sender, args) =>
            {
                Console.WriteLine(args.Text);
            };

            // visiting the schedule with the formatter will fire the DescriptionChanged event,
            // causing the text output to be printed to the console.
            schedule.Accept(formatter);

            // we'll reuse this formatter
            return formatter;
        }
开发者ID:abdojobs,项目名称:dotnet-scheduling,代码行数:25,代码来源:Example.cs


示例16: GetFineOfAddedClass

 public int GetFineOfAddedClass(ISchedule schedule, EntityStorage eStorage)
 {
     StudentSubGroup[] groups = schedule.GetTempClass().SubGroups;
     int day = Constants.GetDayOfClass(schedule.GetTimeOfTempClass());
     List<StudentsClass[]> groupDaySchedule = new List<StudentsClass[]>();
     int fineResult = 0;
     //Проверка является ли добавленная пара пятой
     for (int groupIndex = 0; groupIndex < groups.Length; groupIndex++)
     {
         groupDaySchedule.Add(schedule.GetPartialSchedule(groups[groupIndex]).GetClassesOfDay(day));
         if (schedule.GetTempClass() != groupDaySchedule[groupIndex][Constants.CLASSES_IN_DAY - 2])
         {
             return 0;
         }
     }
     //Проверка отсутствия первой пары
     for (int groupIndex = 0; groupIndex < groups.Length; groupIndex++)
     {
         if (groupDaySchedule[groupIndex][Constants.CLASSES_IN_DAY - 6] == null)
         {
             if (isBlock)
                 return Constants.BLOCK_FINE;
             else
                 fineResult += fine;
         }
     }
     return fineResult;
 }
开发者ID:Kirk7by,项目名称:mandarin,代码行数:28,代码来源:FifthClass.cs


示例17: LotOfClassesInDay

 public static bool LotOfClassesInDay(int maxCountClassesInDay, StudentsClass[,] sClasses, ISchedule schedule, StudentsClass specialClass)
 {
     int rowClass = -1;
     int dayOfSpecialClass = Constants.GetDayOfClass(schedule.GetClassPosition(specialClass).Value.Time);
     //если пара есть в списке "особых пар" - получаю номер строки, в которой располагаются другие "особые" пары
     if ((rowClass = GetRow(sClasses, specialClass)) != -1)
     {
         int dayCount = 0; //количество "особых" пар из полученной строки, поставленных в данный день
         for (int classIndex = 0; classIndex < sClasses.GetLength(1); classIndex++)
         {
             if (sClasses[rowClass, classIndex] == null)
                 continue;
             StudentsClassPosition? position = schedule.GetClassPosition(sClasses[rowClass, classIndex]);
             if (position.HasValue)//если пара установлена
             {
                 if (dayOfSpecialClass == Constants.GetDayOfClass(position.Value.Time))
                     dayCount++;
                 if (dayCount > maxCountClassesInDay)
                 {
                     return true;
                 }
             }
         }
     }
     return false;
 }
开发者ID:Kirk7by,项目名称:mandarin,代码行数:26,代码来源:ClassesInWeek.cs


示例18: AddSchedule

 public void AddSchedule(ISchedule schedule)
 {
     lock (_schedulesSyncro)
     {
         _schedules.Add(schedule);
     }
 }
开发者ID:maxrogoz,项目名称:COSystemArchitect,代码行数:7,代码来源:Scheduler.cs


示例19: GetFineOfAddedClass

 public int GetFineOfAddedClass(ISchedule schedule, EntityStorage eStorage)
 {
     StudentSubGroup[] groups = schedule.GetTempClass().SubGroups;
     int classTime = schedule.GetTimeOfTempClass();
     //Считаем день недели последней добавленной пары
     int dayOfWeek = Constants.GetDayOfClass(classTime);
     //Считаем номер пары в этот день
     int classOfDay = Constants.GetTimeOfClass(classTime);
     int otherWeekDay;
     int fineResult = 0;
     if (dayOfWeek < Constants.DAYS_IN_WEEK)
     {
         otherWeekDay = Constants.DAYS_IN_WEEK;
     }
     else
     {
         otherWeekDay = -Constants.DAYS_IN_WEEK;
     }
     if (dayOfWeek == Constants.DAYS_IN_WEEK - 1)
     {
         foreach (StudentSubGroup subGroup in groups)
         {
             StudentsClass[] classes = schedule.GetPartialSchedule(subGroup).GetClassesOfDay(dayOfWeek + otherWeekDay);
             if (classes[classOfDay] == null)
             {
                 if (isBlock)
                     return Constants.BLOCK_FINE;
                 else
                     fineResult += fine;
             }
         }
     }
     return fineResult;
 }
开发者ID:Kirk7by,项目名称:mandarin,代码行数:34,代码来源:SaturdayClassOneAtWeek.cs


示例20: Subject

 public Subject(string name, int year, IEnumerable<IAbsence> absences, ISchedule schedule, IEnumerable<ITest> tests)
 {
     this.Name = name;
     this.Year = year;
     this.Absences = absences;
     this.Schedule = schedule;
     this.Tests = tests;
 }
开发者ID:Kobzol,项目名称:VIS-project,代码行数:8,代码来源:Subject.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IScheduleService类代码示例发布时间:2022-05-24
下一篇:
C# IScenePresence类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap