public static IPlayItem ToPlayItem(this PlayItemEntity entity, IPlaybillItem playbillItem) { if (playbillItem.ScheduleMode == PlayScheduleMode.Auto) { var autoPlayItem = new AutoPlayItem(playbillItem); autoPlayItem.StartTime = entity.StartTime; autoPlayItem.CalculatedPlayDuration = TimeSpan.FromSeconds(entity.PlayDuration); autoPlayItem.PlayRange = new PlayRange(TimeSpan.FromSeconds(entity.MarkerIn), TimeSpan.FromSeconds(entity.MarkerDuration)); //autoPlayItem.PlaybillItem = playbillItem; autoPlayItem.Id = entity.Id; return(autoPlayItem); } else { return((TimingPlaybillItem)playbillItem); } //throw new NotImplementedException(); }
public static IPlayItem ToPlayItem(this PlayItemEntity entity) { IPlaybillItem playbillItem = entity.PlaybillItem.ToPlaybillItem(); // FromEntity(entity.PlaybillItem); if (playbillItem.ScheduleMode == PlayScheduleMode.Auto) { var autoPlayItem = new AutoPlayItem(playbillItem); autoPlayItem.StartTime = entity.StartTime; autoPlayItem.CalculatedPlayDuration = TimeSpan.FromSeconds(entity.PlayDuration); autoPlayItem.PlayRange = new PlayRange(TimeSpan.FromSeconds(entity.MarkerIn), TimeSpan.FromSeconds(entity.MarkerDuration)); autoPlayItem.Id = entity.Id; return(autoPlayItem); } else { return((TimingPlaybillItem)playbillItem); } }