示例#1
0
        /// <summary>
        /// Adds the work period assignment specified by <see cref="CodeTerm"/> to the schedule.
        /// </summary>
        /// <param name="codeTerm">A <see cref="CodeTerm"/> that references an <see cref="CodeCompoundTerm"/>.</param>
        /// <remarks>
        /// Work periods assignment are compound terms of the form <code>workPeriodAssignment(person,workPeriod(day,shift))</code>.
        /// </remarks>
        private void ProcessWorkPeriodAssignment(CodeTerm codeTerm)
        {
            if (codeTerm == null)
            {
                throw new ArgumentNullException("codeTerm");
            }
            if (!codeTerm.IsCodeCompoundTerm)
            {
                throw new ArgumentException("CodeCompoundTerm not specified.", "codeTerm");
            }

            CodeCompoundTerm codeCompoundTerm = codeTerm.AsCodeCompoundTerm;

            if (codeCompoundTerm.Functor != s_workPeriodAssignmentFunctor)
            {
                throw new ArgumentException("Functor workPeriodAssignment not specified.", "codeTerm");
            }

            string        person        = ProcessPerson(codeCompoundTerm.Children[0]);
            ScheduleShift scheduleShift = ProcessWorkPeriod(codeCompoundTerm.Children[1]);

            scheduleShift.Name = person;
        }
示例#2
0
 public void Copy(ScheduleShift scheduleShift)
 {
     Name = scheduleShift.Name;
 }
示例#3
0
 public void Copy(ScheduleShift scheduleShift)
 {
     Name = scheduleShift.Name;
 }