示例#1
0
        private IConflictCheck BuildCheckChain(IConflictCheck olc)
        {
            IConflictCheck handler = olc;

            handler.SetNext(new NullCheck());

            return(handler);
        }
示例#2
0
        public ConflictCheck(ICalendarEventRepository <CalendarEvent> repository
                             , [Optional] IOverlappingCheck olc)
        {
            _events = repository.GetAll(); // The idea is that, there will be many rule checks (my previous projects have over 30 rules) as well as many events (aka 1000+), so we do not want to connect to database multiple times

            IConflictCheck handler = BuildCheckChain(olc);

            handler.SetNext(new NullCheck()); // Null check always the last one
            _chain = new ConflictCheckChain(handler);
        }
示例#3
0
 public ConflictCheckChain(IConflictCheck _handler)
 {
     handler = _handler;
 }
 public IConflictCheck SetNext(IConflictCheck conflictCheck)
 {
     _nextCheck = conflictCheck;
     return(conflictCheck);
 }