예제 #1
0
        public IChronologicalParametersGroup Create(
            ChronologicalParameterGroupType type)
        {
            switch (type)
            {
            case ChronologicalParameterGroupType.Engine:
                return(new ChronologicalParametersGroupEngine());

            case ChronologicalParameterGroupType.EngineInjection:
                return(new ChronologicalParametersGroupEngineInjection());

            default:
                throw new NotImplementedException();
            }
        }
        private void PlaceToGroup(ChronologicalData data,
                                  IChronologicalParameter parameter)
        {
            ChronologicalParameterGroupType groupType =
                parameterToGroupMapping[parameter.Type];

            if (!data.Groups.Any(g => g.Type == groupType))
            {
                ChronoParamGroupFactory groupFactory =
                    new ChronoParamGroupFactory();
                IChronologicalParametersGroup group =
                    groupFactory.Create(groupType);
                data.Groups.Add(group);
            }
            data.Groups.FirstOrDefault(g =>
                                       g.Type == groupType).Parameters.Add(parameter);
        }