public ObjectBaseSummaryDTO MapFrom(IEventGroupBuilder eventGroup) { var dto = new ObjectBaseSummaryDTO { ApplicationIcon = ApplicationIcons.EventGroup, EntityName = eventGroup.Name }; dto.AddToDictionary(AppConstants.Captions.Type, _objectTypeResolver.TypeFor(eventGroup)); dto.AddToDictionary(AppConstants.Captions.NumberOfChildren, eventGroup.Children.Count().ToString(CultureInfo.InvariantCulture)); return(dto); }
public ObjectBaseSummaryDTO MapFrom(IObserverBuilder observerBuilder) { var dto = new ObjectBaseSummaryDTO { ApplicationIcon = ApplicationIcons.Observer, EntityName = observerBuilder.Name }; dto.AddToDictionary(AppConstants.Captions.Type, _objectTypeResolver.TypeFor(observerBuilder)); return(dto); }
public ObjectBaseSummaryDTO MapFrom(IMoleculeBuilder moleculeBuilder) { var dto = new ObjectBaseSummaryDTO { ApplicationIcon = ApplicationIcons.Molecule, EntityName = moleculeBuilder.Name, }; dto.AddToDictionary(AppConstants.Captions.Type, _objectTypeResolver.TypeFor(moleculeBuilder)); dto.AddToDictionary(AppConstants.Captions.NumberOfParameters, moleculeBuilder.Parameters.Count().ToString(CultureInfo.InvariantCulture)); dto.AddToDictionary(AppConstants.Captions.TransporterMolecules, moleculeBuilder.TransporterMoleculeContainerCollection.Count().ToString(CultureInfo.InvariantCulture)); return(dto); }
public ObjectBaseSummaryDTO MapFrom(IReactionBuilder reactionBuilder) { var dto = new ObjectBaseSummaryDTO { ApplicationIcon = ApplicationIcons.Reaction, EntityName = reactionBuilder.Name }; dto.AddToDictionary(AppConstants.Captions.Type, _objectTypeResolver.TypeFor(reactionBuilder)); dto.AddToDictionary(AppConstants.Captions.NumberOfParameters, reactionBuilder.Parameters.Count().ToString(CultureInfo.InvariantCulture)); dto.AddToDictionary(AppConstants.Captions.Stoichiometry, _stoichiometricStringCreator.CreateFrom(reactionBuilder.Educts, reactionBuilder.Products)); dto.AddToDictionary(AppConstants.Captions.Kinetic, reactionBuilder.Formula != null ? reactionBuilder.Formula.ToString() : string.Empty); return(dto); }
protected ObjectBaseSummaryDTO BaseMapper(T startValue) { var dto = new ObjectBaseSummaryDTO { EntityName = startValue.Name, }; dto.AddToDictionary(AppConstants.Captions.Type, new ObjectTypeResolver().TypeFor(startValue)); dto.AddToDictionary(AppConstants.Captions.Path, startValue.Path.ToString()); if (startValue.StartValue.HasValue) { dto.AddToDictionary(AppConstants.Captions.Value, startValue.GetStartValueAsDisplayString()); } if (hasValidFormula(startValue)) { dto.AddToDictionary(AppConstants.Captions.Formula, startValue.Formula.ToString()); } dto.AddToDictionary(AppConstants.Captions.Dimension, startValue.Dimension.DisplayName); dto.AddToDictionary(AppConstants.Captions.Description, startValue.Description); return(dto); }
public ObjectBaseSummaryDTO MapFrom(ITransportBuilder transportBuilder) { var dto = new ObjectBaseSummaryDTO { ApplicationIcon = ApplicationIcons.PassiveTransport, EntityName = transportBuilder.Name }; dto.AddToDictionary(AppConstants.Captions.Type, ObjectTypes.PassiveTransportBuilder); dto.AddToDictionary(AppConstants.Captions.SourceDescriptor, transportBuilder.SourceCriteria.ToString()); dto.AddToDictionary(AppConstants.Captions.TargetDescriptor, transportBuilder.TargetCriteria.ToString()); dto.AddToDictionary(AppConstants.Captions.ForAll, transportBuilder.ForAll.ToString()); if (transportBuilder.ForAll) { return(dto); } dto.AddToDictionary(AppConstants.Captions.MoleculesToInclude, transportBuilder.MoleculeList.MoleculeNames.ToString(", ")); dto.AddToDictionary(AppConstants.Captions.MoleculesToExclude, transportBuilder.MoleculeList.MoleculeNamesToExclude.ToString(", ")); return(dto); }
public void BindTo(ObjectBaseSummaryDTO objectBase) { _view.BindTo(objectBase); }
protected override void Because() { _result = sut.MapFrom(_builder); }
public void BindTo(ObjectBaseSummaryDTO objectBaseDTO) { _screenBinder.BindToSource(objectBaseDTO); _gridViewBinder.BindToSource(objectBaseDTO.Dictionary.OrderBy(x => x.Key)); svgImageBox.SvgImage = objectBaseDTO.ApplicationIcon; }