public IEventGroupBuilder MapFrom(FlatContainer eventGroupFlatContainer) { var eventGroup = MapCommonPropertiesFrom(eventGroupFlatContainer); foreach (var flatSubContainer in eventGroupSubContainers(eventGroupFlatContainer)) { if (flatSubContainer.Type.Equals(CoreConstants.ContainerType.EVENT_GROUP)) { eventGroup.Add(MapFrom(flatSubContainer)); continue; } if (flatSubContainer.Type.Equals(CoreConstants.ContainerType.EVENT)) { eventGroup.Add(_eventMapper.MapFrom(flatSubContainer)); continue; } throw new PKSimException(PKSimConstants.Error.EventGroupSubContainerHasInvalidType); } addParametersTo(eventGroup); //every event group will be added into events-subcontainer of simulation eventGroup.SourceCriteria.Add(new MatchTagCondition(CoreConstants.Tags.EVENTS)); return eventGroup; }
private void addEvents(IContainer container) { var flatEventSubContainers = flatSubContainersFor(container, x => x == CoreConstants.ContainerType.EVENT); foreach (var flatEventContainer in flatEventSubContainers) { container.Add(_eventMapper.MapFrom(flatEventContainer)); } }