示例#1
0
        private void BulkPrint(IScheduleVisitor formatter)
        {
            // now format a whole list of schedules, remembering that the description event will
            // fire as each schedule is visited
            var schedules = new List <Schedule>()
            {
                new DailySchedule()
                {
                    Frequency = 1
                },
                new WeeklySchedule()
                {
                    Frequency = 1, Wednesday = true
                },
                new MonthlySchedule()
                {
                    Frequency = 3
                },
                new MonthlyDaySchedule()
                {
                    Frequency = 3
                },
                new YearlySchedule()
                {
                    Frequency = 4
                }
            };

            foreach (var s in schedules)
            {
                s.Accept(formatter);
            }
        }
 public void Accept(IScheduleVisitor entity)
 {
     // the standard IScheduleVisitor doesn't know about our custom type
     // unfortunately to wire it up correctly, we need to type check
     if (entity is IExtendedScheduleVisitor)
         Accept((IExtendedScheduleVisitor)entity);
 }
 public void Accept(IScheduleVisitor entity)
 {
     // the standard IScheduleVisitor doesn't know about our custom type
     // unfortunately to wire it up correctly, we need to type check
     if (entity is IExtendedScheduleVisitor)
     {
         Accept((IExtendedScheduleVisitor)entity);
     }
 }
示例#4
0
        private void BulkPrint(IScheduleVisitor formatter)
        {
            // now format a whole list of schedules, remembering that the description event will
            // fire as each schedule is visited
            var schedules = new List<Schedule>() { 
                new DailySchedule() { Frequency = 1 }, 
                new WeeklySchedule() { Frequency = 1, Wednesday = true }, 
                new MonthlySchedule() { Frequency = 3 },
                new MonthlyDaySchedule() { Frequency = 3 }, 
                new YearlySchedule() { Frequency = 4 }
            };

            foreach (var s in schedules)
                s.Accept(formatter);
        }
示例#5
0
 public override void Accept(IScheduleVisitor entity)
 {
     entity.Visit(this);
 }
 public override void Accept(IScheduleVisitor entity)
 {
     entity.Visit(this);
 }
示例#7
0
 public abstract void Accept(IScheduleVisitor entity);
示例#8
0
 public abstract void Accept(IScheduleVisitor entity);