コード例 #1
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="owner">所属的Day对象,类型Day</param>
 /// <param name="section">节次(从零开始),类型int</param>
 /// <param name="teacher">教师,类型Teacher</param>
 public Lesson(DaySchedule owner, int section = 0, Teacher teacher = null)
 {
     _day       = owner;
     _section   = section;
     _teacher   = teacher;
     _canModify = true;
 }
コード例 #2
0
 /// <summary>
 /// 复制构造函数
 /// </summary>
 /// <param name="other"></param>
 /// <param name="owner"></param>
 public Lesson(Lesson other, DaySchedule owner = null)
 {
     _section  = other._section;
     _forenoon = other._forenoon;
     _teacher  = other._teacher;
     if (owner == null)
     {
         _day = other._day;
     }
     else
     {
         _day = owner;
     }
 }
コード例 #3
0
ファイル: DaySchedule.cs プロジェクト: yucnet/ScheduleHelper
        /// <summary>
        /// 复制构造函数
        /// </summary>
        /// <param name="other"></param>
        /// <param name="_class"></param>
        public DaySchedule(DaySchedule other, ClassSchedule _class = null)
        {
            _dayOfWeek     = other._dayOfWeek;
            _assginedCount = other._assginedCount;
            _lessons       = new List <Lesson>(other._lessons.Count);
            foreach (Lesson l in other._lessons)
            {
                _lessons.Add(new Lesson(l, this));
            }

            if (_class == null)
            {
                this._class = other._class;
            }
            else
            {
                this._class = _class;
            }
        }