public void AddProduct(SpeciesDescription si) { if (_reaction.Products.Any(p => p.Locale != si.Locale)) { throw new ArgumentException("All products of a reaction must come from the same locale."); } _reaction._products.Add(si); }
public void AddSpecies(SpeciesDescription species) { if (_model._species.Where(si => si.Locale == species.Locale).Any(si => si.Name == species.Name)) { throw new ArgumentException("Species '" + species + "' already exists in the model."); } _model._species.Add(species); }
public void AddReactant(SpeciesDescription si) { if (_reaction.Reactants.Any(r => r.Locale != si.Locale)) { throw new ArgumentException("All reactants of a reaction must come from the same locale."); } _reaction._reactants.Add(si); }