예제 #1
0
        public static DayFactory Create(BlockStartTime blockStart)
        {
            var kernel = new StandardKernel();

            kernel.Bind <BlockStartTime>().ToConstant(blockStart);
            return(kernel.Get <DayFactory>());
        }
예제 #2
0
        public static Table FromPersistenceTable(Persistence.Table table)
        {
            var blockType = new BlockStartTime(table.BlockStartTimes).BlockType;
            var weekdays  = table.Weekdays.Select(w => FromPersistenceDay(w, blockType));

            return(new Table(table.Id, weekdays));
        }
예제 #3
0
 public static Persistence.Table ToPersistenceTable(BlockStartTime startTimes, Table table)
 {
     return(new Persistence.Table
     {
         BlockStartTimes = startTimes.ToArray(),
         Weekdays = ToPersistence(table.Days).ToArray()
     });
 }
예제 #4
0
        private static Block FromPersistenceBlock(Persistence.Block b, string blockType)
        {
            var begin = BlockStartTime.FromString(b.Begin);

            return(Block.Create(begin, b.Name, blockType));
        }
예제 #5
0
 public BreakDuration(BlockStartTime blockStartTime, BreakStartTime breakStart)
 {
     _blockStartTime = blockStartTime;
     _blockDuration  = blockStartTime.BlockDuration;
     _breakStart     = breakStart;
 }
예제 #6
0
 public BreakStartTime(BlockStartTime blockStartTime)
 {
     _blockStartTime = blockStartTime;
     _blockDuration  = blockStartTime.BlockDuration;
 }
예제 #7
0
 public BlockFactory(BlockStartTime startTime)
 {
     _startTime = startTime;
 }