public void Handle(AddSchemaItemToSchemaEvent eventToHandle) { if (!canHandle(eventToHandle)) { return; } var schemaDTO = schemaDTOFrom(eventToHandle.Container); schemaDTO.AddSchemaItem(_schemaItemDTOMapper.MapFrom(eventToHandle.Entity)); _view.Rebind(); OnStatusChanged(); }
public SchemaDTO MapFrom(Schema schema) { var schemaDTO = new SchemaDTO(schema, schema.TimeBetweenRepetitions.Dimension); schemaDTO.TimeBetweenRepetitionsParameter = _parameterDTOMapper.MapFrom(schema.TimeBetweenRepetitions, schemaDTO, x => x.TimeBetweenRepetitions, x => x.TimeBetweenRepetitionsParameter); schemaDTO.StartTimeParameter = _parameterDTOMapper.MapFrom(schema.StartTime, schemaDTO, x => x.StartTime, x => x.StartTimeParameter); schemaDTO.NumberOfRepetitionsParameter = _parameterDTOMapper.MapFrom(schema.NumberOfRepetitions, schemaDTO, x => x.NumberOfRepetitions, x => x.NumberOfRepetitionsParameter); schema.SchemaItems.OrderBy(x => x.Name).Each(item => schemaDTO.AddSchemaItem(_schemaItemDtoMapper.MapFrom(item))); return(schemaDTO); }